mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Requested changes implemented - basic functionality working
This commit is contained in:
16
src/app/shared/log-in/methods/authMethods-decorator.ts
Normal file
16
src/app/shared/log-in/methods/authMethods-decorator.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { AuthMethodType } from './authMethods-type';
|
||||
|
||||
const authMethodsMap = new Map();
|
||||
|
||||
export function renderAuthMethodFor(authMethodType: AuthMethodType) {
|
||||
return function decorator(objectElement: any) {
|
||||
if (!objectElement) {
|
||||
return;
|
||||
}
|
||||
authMethodsMap.set(authMethodType, objectElement);
|
||||
};
|
||||
}
|
||||
|
||||
export function rendersAuthMethodType(authMethodType: AuthMethodType) {
|
||||
return authMethodsMap.get(authMethodType);
|
||||
}
|
7
src/app/shared/log-in/methods/authMethods-type.ts
Normal file
7
src/app/shared/log-in/methods/authMethods-type.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export enum AuthMethodType {
|
||||
Password = 'password',
|
||||
Shibboleth = 'shibboleth',
|
||||
Ldap = 'ldap',
|
||||
Ip = 'ip',
|
||||
X509 = 'x509'
|
||||
}
|
@@ -20,8 +20,8 @@ import { CoreState } from '../../../../core/core.reducers';
|
||||
import { isNotEmpty } from '../../../empty.util';
|
||||
import { fadeOut } from '../../../animations/fade';
|
||||
import { AuthService } from '../../../../core/auth/auth.service';
|
||||
import { AuthMethodType } from '../../authMethods-type';
|
||||
import { renderAuthMethodFor } from '../../authMethods-decorator';
|
||||
import { AuthMethodType } from '../authMethods-type';
|
||||
import { renderAuthMethodFor } from '../authMethods-decorator';
|
||||
|
||||
/**
|
||||
* /users/sign-in
|
||||
|
@@ -3,9 +3,17 @@
|
||||
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit"
|
||||
[disabled]="!shibbForm.valid"
|
||||
>{{"login.shibbForm.submit" | translate}}</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<!--
|
||||
<div *ngIf="!(loading | async) && !(isAuthenticated | async)" class="form-login px-4 py-3">
|
||||
<button class="btn btn-lg btn-primary btn-block mt-3"
|
||||
type="submit"
|
||||
[formControl]="shibbButton"
|
||||
(click)="submit()"
|
||||
>{{"login.shibbForm.submit" | translate}}</button>
|
||||
</div>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { Component, EventEmitter, Inject, Input, OnInit, Output, QueryList, ViewChildren } from '@angular/core';
|
||||
import { renderAuthMethodFor } from '../../authMethods-decorator';
|
||||
import { AuthMethodType } from '../../authMethods-type';
|
||||
import { renderAuthMethodFor } from '../authMethods-decorator';
|
||||
import { AuthMethodType } from '../authMethods-type';
|
||||
import { AuthMethodModel } from '../../../../core/auth/models/auth-method.model';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { CoreState } from '../../../../core/core.reducers';
|
||||
import { StartShibbolethAuthenticationAction } from '../../../../core/auth/auth.actions';
|
||||
@@ -42,6 +42,8 @@ export class DynamicShibbolethComponent implements OnInit {
|
||||
|
||||
private host: string;
|
||||
|
||||
// public shibbButton: FormControl;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
@@ -63,6 +65,8 @@ export class DynamicShibbolethComponent implements OnInit {
|
||||
shibbButton: [''],
|
||||
});
|
||||
|
||||
// this.shibbButton = new FormControl('');
|
||||
|
||||
// set isAuthenticated
|
||||
this.isAuthenticated = this.store.pipe(select(isAuthenticated));
|
||||
|
||||
|
Reference in New Issue
Block a user