mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Dynamic rendering of auth methods via decorator
This commit is contained in:
@@ -20,6 +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';
|
||||
|
||||
/**
|
||||
* /users/sign-in
|
||||
@@ -31,6 +33,7 @@ import {AuthService} from '../../../../core/auth/auth.service';
|
||||
styleUrls: ['./log-in-password.component.scss'],
|
||||
animations: [fadeOut]
|
||||
})
|
||||
@renderAuthMethodFor(AuthMethodType.Password)
|
||||
export class LogInPasswordComponent implements OnDestroy, OnInit {
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,7 @@
|
||||
|
||||
import {Component, Inject, Input, OnInit} from '@angular/core';
|
||||
import { renderAuthMethodFor } from '../../authMethods-decorator';
|
||||
import { AuthMethodType } from '../../authMethods-type';
|
||||
import { AuthMethodModel } from '../../../../core/auth/models/auth-method.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-dynamic-shibboleth',
|
||||
@@ -7,11 +9,17 @@ import {Component, Inject, Input, OnInit} from '@angular/core';
|
||||
styleUrls: ['./dynamic-shibboleth.component.scss'],
|
||||
|
||||
})
|
||||
export class DynamicShibbolethComponent {
|
||||
@renderAuthMethodFor(AuthMethodType.Shibboleth)
|
||||
export class DynamicShibbolethComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
constructor(@Inject('shibbolethUrlProvider') public injectedShibbolethUrl: string) {
|
||||
constructor(@Inject('authMethodProvider') public injectedObject: AuthMethodModel) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log('injectedObject', this.injectedObject)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user