mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 20:13:07 +00:00
70373: Store authenticated EPerson ID in store instead of object
This commit is contained in:
@@ -5,9 +5,10 @@ import { select, Store } from '@ngrx/store';
|
||||
|
||||
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
||||
import { AppState } from '../../../app.reducer';
|
||||
import { getAuthenticatedUser, isAuthenticationLoading } from '../../../core/auth/selectors';
|
||||
import { isAuthenticationLoading } from '../../../core/auth/selectors';
|
||||
import { MYDSPACE_ROUTE } from '../../../+my-dspace-page/my-dspace-page.component';
|
||||
import { getProfileModulePath } from '../../../app-routing.module';
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
|
||||
/**
|
||||
* This component represents the user nav menu.
|
||||
@@ -42,7 +43,8 @@ export class UserMenuComponent implements OnInit {
|
||||
*/
|
||||
public profileRoute = getProfileModulePath();
|
||||
|
||||
constructor(private store: Store<AppState>) {
|
||||
constructor(private store: Store<AppState>,
|
||||
private authService: AuthService) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +56,7 @@ export class UserMenuComponent implements OnInit {
|
||||
this.loading$ = this.store.pipe(select(isAuthenticationLoading));
|
||||
|
||||
// set user
|
||||
this.user$ = this.store.pipe(select(getAuthenticatedUser));
|
||||
this.user$ = this.authService.getAuthenticatedUserFromStore();
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user