mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Removed isStandAlone from store
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
AddAuthenticationMessageAction,
|
||||
AuthenticatedAction,
|
||||
AuthenticationSuccessAction,
|
||||
ResetAuthenticationMessagesAction, SetIsStandalonePageInAuthMethodsAction
|
||||
ResetAuthenticationMessagesAction
|
||||
} from '../core/auth/auth.actions';
|
||||
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
||||
import { AuthTokenInfo } from '../core/auth/models/auth-token-info.model';
|
||||
|
@@ -23,7 +23,6 @@ export const AuthActionTypes = {
|
||||
RETRIEVE_AUTH_METHODS: type('dspace/auth/RETRIEVE_AUTH_METHODS'),
|
||||
RETRIEVE_AUTH_METHODS_SUCCESS: type('dspace/auth/RETRIEVE_AUTH_METHODS_SUCCESS'),
|
||||
RETRIEVE_AUTH_METHODS_ERROR: type('dspace/auth/RETRIEVE_AUTH_METHODS_ERROR'),
|
||||
SET_IS_STANDALONE_PAGE_IN_AUTH_METHODS: type('dspace/auth/SET_IS_STANDALONE_PAGE_IN_AUTH_METHODS'),
|
||||
REDIRECT_TOKEN_EXPIRED: type('dspace/auth/REDIRECT_TOKEN_EXPIRED'),
|
||||
REDIRECT_AUTHENTICATION_REQUIRED: type('dspace/auth/REDIRECT_AUTHENTICATION_REQUIRED'),
|
||||
REFRESH_TOKEN: type('dspace/auth/REFRESH_TOKEN'),
|
||||
@@ -366,23 +365,18 @@ export class RetrieveAuthMethodsSuccessAction implements Action {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if token is already present upon initial load.
|
||||
* @class CheckAuthenticationTokenAction
|
||||
* @implements {Action}
|
||||
*/
|
||||
export class RetrieveAuthMethodsErrorAction implements Action {
|
||||
public type: string = AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR;
|
||||
}
|
||||
|
||||
export class SetIsStandalonePageInAuthMethodsAction implements Action {
|
||||
/*export class SetIsStandalonePageInAuthMethodsAction implements Action {
|
||||
type: string = AuthActionTypes.SET_IS_STANDALONE_PAGE_IN_AUTH_METHODS;
|
||||
payload: boolean;
|
||||
|
||||
constructor(isStandAlonePage: boolean) {
|
||||
this.payload = isStandAlonePage;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Change the redirect url.
|
||||
@@ -423,5 +417,4 @@ export type AuthActions
|
||||
| ResetAuthenticationMessagesAction
|
||||
| RetrieveAuthMethodsAction
|
||||
| RetrieveAuthMethodsSuccessAction
|
||||
| SetIsStandalonePageInAuthMethodsAction
|
||||
| RetrieveAuthMethodsErrorAction;
|
||||
|
@@ -28,9 +28,8 @@ import {
|
||||
RegistrationErrorAction,
|
||||
RegistrationSuccessAction,
|
||||
RetrieveAuthMethodsAction,
|
||||
RetrieveAuthMethodsErrorAction,
|
||||
RetrieveAuthMethodsSuccessAction,
|
||||
GetJWTafterShibbLoginAction, StartShibbolethAuthenticationAction
|
||||
GetJWTafterShibbLoginAction, StartShibbolethAuthenticationAction, RetrieveAuthMethodsErrorAction
|
||||
} from './auth.actions';
|
||||
import { EPerson } from '../eperson/models/eperson.model';
|
||||
import { AuthStatus } from './models/auth-status.model';
|
||||
|
@@ -8,7 +8,7 @@ import {
|
||||
LogOutErrorAction,
|
||||
RedirectWhenAuthenticationIsRequiredAction,
|
||||
RedirectWhenTokenExpiredAction,
|
||||
RefreshTokenSuccessAction, RetrieveAuthMethodsSuccessAction, SetIsStandalonePageInAuthMethodsAction,
|
||||
RefreshTokenSuccessAction, RetrieveAuthMethodsSuccessAction,
|
||||
SetRedirectUrlAction
|
||||
} from './auth.actions';
|
||||
// import models
|
||||
@@ -220,7 +220,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut
|
||||
authMethods: (action as RetrieveAuthMethodsSuccessAction).payload
|
||||
});
|
||||
|
||||
case AuthActionTypes.SET_IS_STANDALONE_PAGE_IN_AUTH_METHODS:
|
||||
/* case AuthActionTypes.SET_IS_STANDALONE_PAGE_IN_AUTH_METHODS:
|
||||
const authMethods: AuthMethodModel[] = state.authMethods;
|
||||
const newAuthMethods: AuthMethodModel[] = new Array<AuthMethodModel>();
|
||||
const isStandAlonePage: boolean = (action as SetIsStandalonePageInAuthMethodsAction).payload;
|
||||
@@ -228,7 +228,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut
|
||||
const newAuthMethod = new AuthMethodModel(authMethod.authMethodType, authMethod.location, isStandAlonePage);
|
||||
newAuthMethods.push(newAuthMethod);
|
||||
}
|
||||
return Object.assign({}, state, {authMethods: newAuthMethods});
|
||||
return Object.assign({}, state, {authMethods: newAuthMethods});*/
|
||||
|
||||
case AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR:
|
||||
return Object.assign({}, state, {
|
||||
|
@@ -4,9 +4,9 @@ import { ShibbConstants } from '../../../+login-page/shibbolethTargetPage/const/
|
||||
export class AuthMethodModel {
|
||||
authMethodType: AuthMethodType;
|
||||
location?: string;
|
||||
isStandalonePage? = true;
|
||||
// isStandalonePage? = true;
|
||||
|
||||
constructor(authMethodName: string, location?: string, isStandAlonePage?: boolean) {
|
||||
constructor(authMethodName: string, location?: string) {
|
||||
switch (authMethodName) {
|
||||
case 'ip': {
|
||||
this.authMethodType = AuthMethodType.Ip;
|
||||
|
@@ -4,7 +4,6 @@ import { Store } from '@ngrx/store';
|
||||
import { CoreState } from '../../../core/core.reducers';
|
||||
import { AuthMethodModel } from '../../../core/auth/models/auth-method.model';
|
||||
|
||||
|
||||
/**
|
||||
* This component represents a section that contains the submission license form.
|
||||
*/
|
||||
@@ -47,7 +46,6 @@ export class LoginContainerComponent implements OnInit {
|
||||
* Find the correct component based on the AuthMethod's type
|
||||
*/
|
||||
getAuthMethodContent(): string {
|
||||
console.log('Trying to render login component for type: ', this.authMethodModel.authMethodType);
|
||||
return rendersAuthMethodType(this.authMethodModel.authMethodType)
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,6 @@ import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } fr
|
||||
import { CoreState } from '../../core/core.reducers';
|
||||
import { filter, takeWhile, } from 'rxjs/operators';
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { SetIsStandalonePageInAuthMethodsAction } from '../../core/auth/auth.actions';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-log-in',
|
||||
@@ -46,7 +45,7 @@ export class LogInComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
this.store.dispatch(new SetIsStandalonePageInAuthMethodsAction(this.isStandalonePage));
|
||||
// this.store.dispatch(new SetIsStandalonePageInAuthMethodsAction(this.isStandalonePage));
|
||||
|
||||
this.authMethodData = this.store.pipe(
|
||||
select(getAuthenticationMethods),
|
||||
|
@@ -1,4 +1,3 @@
|
||||
<!--*ngIf="!(loading | async) && !(isAuthenticated | async)" class="form-login px-4 py-3"-->
|
||||
<form (ngSubmit)="submit()"
|
||||
[formGroup]="form" novalidate>
|
||||
<label for="inputEmail" class="sr-only">{{"login.form.email" | translate}}</label>
|
||||
|
@@ -10,7 +10,7 @@ import { AuthMethodModel } from '../../../../core/auth/models/auth-method.model'
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { CoreState } from '../../../../core/core.reducers';
|
||||
import { StartShibbolethAuthenticationAction } from '../../../../core/auth/auth.actions';
|
||||
import { SetRedirectUrlAction, StartShibbolethAuthenticationAction } from '../../../../core/auth/auth.actions';
|
||||
import { Observable } from 'rxjs';
|
||||
import {
|
||||
isAuthenticated,
|
||||
@@ -58,6 +58,7 @@ export class LogInShibbolethComponent implements OnInit {
|
||||
}
|
||||
|
||||
submit() {
|
||||
this.store.dispatch(new SetRedirectUrlAction('/mytest/url'));
|
||||
this.store.dispatch(new StartShibbolethAuthenticationAction(this.authMethodModel));
|
||||
// https://host/Shibboleth.sso/Login?target=https://host/shibboleth
|
||||
window.location.href = this.injectedAuthMethodModel.location;
|
||||
|
Reference in New Issue
Block a user