diff --git a/src/app/core/auth/models/auth-method.model.ts b/src/app/core/auth/models/auth-method.model.ts index c785506d1b..21b130fb2e 100644 --- a/src/app/core/auth/models/auth-method.model.ts +++ b/src/app/core/auth/models/auth-method.model.ts @@ -1,30 +1,30 @@ export class AuthMethodModel { authMethodName: string; location?: string; - authMethodConstant: AuthMethodConstants + authMethodConstant: AuthMethodType constructor(authMethodName: string, location?: string) { this.authMethodName = authMethodName; this.location = location; switch (authMethodName) { case 'ip': { - this.authMethodConstant = AuthMethodConstants.IP; + this.authMethodConstant = AuthMethodType.Ip; break; } case 'ldap': { - this.authMethodConstant = AuthMethodConstants.LDAP; + this.authMethodConstant = AuthMethodType.Ldap; break; } case 'shibboleth': { - this.authMethodConstant = AuthMethodConstants.SHIBBOLETH; + this.authMethodConstant = AuthMethodType.Shibboleth; break; } case 'x509': { - this.authMethodConstant = AuthMethodConstants.X509; + this.authMethodConstant = AuthMethodType.X509; break; } case 'password': { - this.authMethodConstant = AuthMethodConstants.PASSWORD; + this.authMethodConstant = AuthMethodType.Password; break; } @@ -35,10 +35,10 @@ export class AuthMethodModel { } } -export enum AuthMethodConstants { - IP, - LDAP, - SHIBBOLETH, - X509, - PASSWORD, +export enum AuthMethodType { + Password = 'password', + Shibboleth = 'shibboleth', + Ldap = 'ldap', + Ip = 'ip', + X509 = 'x509' } diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts index 7b5f0a0414..4ef4ad654e 100644 --- a/src/app/shared/log-in/log-in.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -5,7 +5,7 @@ import {getAuthenticationMethods} from '../../core/auth/selectors'; import {map} from 'rxjs/operators'; import {AppState} from '../../app.reducer'; import {Observable} from 'rxjs'; -import {AuthMethodConstants} from '../../core/auth/models/auth-method.model'; +import {AuthMethodType} from '../../core/auth/models/auth-method.model'; import {DynamicLoginMethod} from './log-in.model'; import {LogInPasswordComponent} from './methods/password/log-in-password.component'; @@ -54,10 +54,10 @@ export class LogInComponent implements OnDestroy, OnInit { this.dynamicLoginMethods = this.store.select(getAuthenticationMethods).pipe( map(((authMethods) => authMethods.map((authMethod) => { switch (authMethod.authMethodConstant) { - case AuthMethodConstants.PASSWORD: + case AuthMethodType.Password: return new DynamicLoginMethod(authMethod.authMethodName, LogInPasswordComponent) break; - case AuthMethodConstants.SHIBBOLETH: + case AuthMethodType.Shibboleth: this.shibbolethUrl = authMethod.location; // this.shibbolethUrl = 'https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login?target=https://fis.tiss.tuwien.ac.at/shibboleth'; return new DynamicLoginMethod(authMethod.authMethodName, DynamicShibbolethComponent, authMethod.location) @@ -73,19 +73,6 @@ export class LogInComponent implements OnDestroy, OnInit { } - /* this.dynamicLoginMethods = this.dynamicLoginMethods = [ - { - label: 'PasswordComponent', - component: LogInComponent - }, - { - label: 'ShibbolethComponent', - component: DynamicShibbolethComponent - }, - - ]; - }*/ - /** * Lifecycle hook that is called when a directive, pipe or service is destroyed. * @method ngOnDestroy