mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
Dynamic rendering of auth methods via decorator
This commit is contained in:
@@ -1,30 +1,32 @@
|
||||
import {AuthMethodType} from '../../../shared/log-in/authMethods-type';
|
||||
|
||||
export class AuthMethodModel {
|
||||
authMethodName: string;
|
||||
location?: string;
|
||||
authMethodConstant: AuthMethodType
|
||||
authMethodType: AuthMethodType
|
||||
|
||||
constructor(authMethodName: string, location?: string) {
|
||||
this.authMethodName = authMethodName;
|
||||
this.location = location;
|
||||
switch (authMethodName) {
|
||||
case 'ip': {
|
||||
this.authMethodConstant = AuthMethodType.Ip;
|
||||
this.authMethodType = AuthMethodType.Ip;
|
||||
break;
|
||||
}
|
||||
case 'ldap': {
|
||||
this.authMethodConstant = AuthMethodType.Ldap;
|
||||
this.authMethodType = AuthMethodType.Ldap;
|
||||
break;
|
||||
}
|
||||
case 'shibboleth': {
|
||||
this.authMethodConstant = AuthMethodType.Shibboleth;
|
||||
this.authMethodType = AuthMethodType.Shibboleth;
|
||||
break;
|
||||
}
|
||||
case 'x509': {
|
||||
this.authMethodConstant = AuthMethodType.X509;
|
||||
this.authMethodType = AuthMethodType.X509;
|
||||
break;
|
||||
}
|
||||
case 'password': {
|
||||
this.authMethodConstant = AuthMethodType.Password;
|
||||
this.authMethodType = AuthMethodType.Password;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,11 +36,3 @@ export class AuthMethodModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export enum AuthMethodType {
|
||||
Password = 'password',
|
||||
Shibboleth = 'shibboleth',
|
||||
Ldap = 'ldap',
|
||||
Ip = 'ip',
|
||||
X509 = 'x509'
|
||||
}
|
||||
|
Reference in New Issue
Block a user