mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-19 16:03:02 +00:00
Added cases needed for shobboleth login to reducer
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
|||||||
LogOutErrorAction,
|
LogOutErrorAction,
|
||||||
RedirectWhenAuthenticationIsRequiredAction,
|
RedirectWhenAuthenticationIsRequiredAction,
|
||||||
RedirectWhenTokenExpiredAction,
|
RedirectWhenTokenExpiredAction,
|
||||||
RefreshTokenSuccessAction,
|
RefreshTokenSuccessAction, RetrieveAuthMethodsSuccessAction,
|
||||||
SetRedirectUrlAction
|
SetRedirectUrlAction
|
||||||
} from './auth.actions';
|
} from './auth.actions';
|
||||||
// import models
|
// import models
|
||||||
@@ -45,6 +45,9 @@ export interface AuthState {
|
|||||||
// true when refreshing token
|
// true when refreshing token
|
||||||
refreshing?: boolean;
|
refreshing?: boolean;
|
||||||
|
|
||||||
|
// sso login url
|
||||||
|
ssoLoginUrl?: string;
|
||||||
|
|
||||||
// the authenticated user
|
// the authenticated user
|
||||||
user?: EPerson;
|
user?: EPerson;
|
||||||
}
|
}
|
||||||
@@ -56,6 +59,7 @@ const initialState: AuthState = {
|
|||||||
authenticated: false,
|
authenticated: false,
|
||||||
loaded: false,
|
loaded: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
ssoLoginUrl: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -187,6 +191,23 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut
|
|||||||
info: undefined,
|
info: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// next three cases are used by shibboleth login
|
||||||
|
case AuthActionTypes.RETRIEVE_AUTH_METHODS:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
loading: true
|
||||||
|
});
|
||||||
|
|
||||||
|
case AuthActionTypes.RETRIEVE_AUTH_METHODS_SUCCESS:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
loading: false,
|
||||||
|
ssoLoginUrl: (action as RetrieveAuthMethodsSuccessAction).payload
|
||||||
|
});
|
||||||
|
|
||||||
|
case AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR:
|
||||||
|
return Object.assign({}, state, {
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
|
||||||
case AuthActionTypes.SET_REDIRECT_URL:
|
case AuthActionTypes.SET_REDIRECT_URL:
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
redirectUrl: (action as SetRedirectUrlAction).payload,
|
redirectUrl: (action as SetRedirectUrlAction).payload,
|
||||||
|
Reference in New Issue
Block a user