Improvement for authentication module

This commit is contained in:
Giuseppe Digilio
2018-02-09 09:55:55 +01:00
parent ae584915cf
commit 2f19f32d91
23 changed files with 431 additions and 124 deletions

View File

@@ -6,6 +6,7 @@ import { type } from '../../shared/ngrx/type';
// import models
import { Eperson } from '../eperson/models/eperson.model';
import { AuthTokenInfo } from './models/auth-token-info.model';
export const AuthActionTypes = {
AUTHENTICATE: type('dspace/auth/AUTHENTICATE'),
@@ -49,9 +50,9 @@ export class AuthenticateAction implements Action {
*/
export class AuthenticatedAction implements Action {
public type: string = AuthActionTypes.AUTHENTICATED;
payload: string;
payload: AuthTokenInfo;
constructor(token: string) {
constructor(token: AuthTokenInfo) {
this.payload = token;
}
}
@@ -108,10 +109,10 @@ export class AuthenticationErrorAction implements Action {
*/
export class AuthenticationSuccessAction implements Action {
public type: string = AuthActionTypes.AUTHENTICATE_SUCCESS;
payload: Eperson;
payload: AuthTokenInfo;
constructor(user: Eperson) {
this.payload = user;
constructor(token: AuthTokenInfo) {
this.payload = token;
}
}