mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Auth module improvement
This commit is contained in:
@@ -17,6 +17,7 @@ export const AuthActionTypes = {
|
||||
AUTHENTICATED_SUCCESS: type('dspace/auth/AUTHENTICATED_SUCCESS'),
|
||||
CHECK_AUTHENTICATION_TOKEN: type('dspace/auth/CHECK_AUTHENTICATION_TOKEN'),
|
||||
CHECK_AUTHENTICATION_TOKEN_ERROR: type('dspace/auth/CHECK_AUTHENTICATION_TOKEN_ERROR'),
|
||||
REDIRECT: type('dspace/auth/REDIRECT'),
|
||||
RESET_ERROR: type('dspace/auth/RESET_ERROR'),
|
||||
LOG_OUT: type('dspace/auth/LOG_OUT'),
|
||||
LOG_OUT_ERROR: type('dspace/auth/LOG_OUT_ERROR'),
|
||||
@@ -136,15 +137,6 @@ export class CheckAuthenticationTokenErrorAction implements Action {
|
||||
public type: string = AuthActionTypes.CHECK_AUTHENTICATION_TOKEN_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset error.
|
||||
* @class ResetAuthenticationErrorAction
|
||||
* @implements {Action}
|
||||
*/
|
||||
export class ResetAuthenticationErrorAction implements Action {
|
||||
public type: string = AuthActionTypes.RESET_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign out.
|
||||
* @class LogOutAction
|
||||
@@ -179,6 +171,20 @@ export class LogOutSuccessAction implements Action {
|
||||
constructor(public payload?: any) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to login page when token is expired.
|
||||
* @class RedirectWhenTokenExpiredAction
|
||||
* @implements {Action}
|
||||
*/
|
||||
export class RedirectWhenTokenExpiredAction implements Action {
|
||||
public type: string = AuthActionTypes.REDIRECT;
|
||||
payload: string;
|
||||
|
||||
constructor(message: string) {
|
||||
this.payload = message ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign up.
|
||||
* @class RegistrationAction
|
||||
@@ -221,6 +227,15 @@ export class RegistrationSuccessAction implements Action {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset error.
|
||||
* @class ResetAuthenticationErrorAction
|
||||
* @implements {Action}
|
||||
*/
|
||||
export class ResetAuthenticationErrorAction implements Action {
|
||||
public type: string = AuthActionTypes.RESET_ERROR;
|
||||
}
|
||||
|
||||
/* tslint:enable:max-classes-per-file */
|
||||
|
||||
/**
|
||||
@@ -237,6 +252,7 @@ export type AuthActions
|
||||
| AuthenticationSuccessAction
|
||||
| CheckAuthenticationTokenAction
|
||||
| CheckAuthenticationTokenErrorAction
|
||||
| RedirectWhenTokenExpiredAction
|
||||
| RegistrationAction
|
||||
| RegistrationErrorAction
|
||||
| RegistrationSuccessAction;
|
||||
|
Reference in New Issue
Block a user