mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 11:03:05 +00:00
Removed use of platform service and created different service for SSR and CSR
This commit is contained in:
@@ -9,7 +9,8 @@ import 'rxjs/add/operator/takeWhile';
|
||||
import { AuthenticateAction, ResetAuthenticationMessagesAction } from '../../core/auth/auth.actions';
|
||||
|
||||
import {
|
||||
getAuthenticationError, getAuthenticationInfo,
|
||||
getAuthenticationError,
|
||||
getAuthenticationInfo,
|
||||
isAuthenticated,
|
||||
isAuthenticationLoading,
|
||||
} from '../../core/auth/selectors';
|
||||
@@ -18,7 +19,6 @@ import { CoreState } from '../../core/core.reducers';
|
||||
import { isNotEmpty } from '../empty.util';
|
||||
import { fadeOut } from '../animations/fade';
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { PlatformService } from '../services/platform.service';
|
||||
|
||||
/**
|
||||
* /users/sign-in
|
||||
@@ -56,6 +56,12 @@ export class LogInComponent implements OnDestroy, OnInit {
|
||||
*/
|
||||
public hasMessage = false;
|
||||
|
||||
/**
|
||||
* Whether user is authenticated.
|
||||
* @type {Observable<string>}
|
||||
*/
|
||||
public isAuthenticated: Observable<boolean>;
|
||||
|
||||
/**
|
||||
* True if the authentication is loading.
|
||||
* @type {boolean}
|
||||
@@ -83,15 +89,18 @@ export class LogInComponent implements OnDestroy, OnInit {
|
||||
constructor(
|
||||
private authService: AuthService,
|
||||
private formBuilder: FormBuilder,
|
||||
private platform: PlatformService,
|
||||
private store: Store<CoreState>
|
||||
) { }
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Lifecycle hook that is called after data-bound properties of a directive are initialized.
|
||||
* @method ngOnInit
|
||||
*/
|
||||
public ngOnInit() {
|
||||
// set isAuthenticated
|
||||
this.isAuthenticated = this.store.select(isAuthenticated);
|
||||
|
||||
// set formGroup
|
||||
this.form = this.formBuilder.group({
|
||||
email: ['', Validators.required],
|
||||
@@ -144,7 +153,7 @@ export class LogInComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* To to the registration page.
|
||||
* To the registration page.
|
||||
* @method register
|
||||
*/
|
||||
public register() {
|
||||
|
Reference in New Issue
Block a user