[CST-14902][CST-15073][CST-15074] Adds ORCID login flow with private email

This commit is contained in:
Alisa Ismailati
2023-09-25 18:10:26 +02:00
committed by Vincenzo Mecca
parent fca5700012
commit 214a77a65c
89 changed files with 3452 additions and 276 deletions

View File

@@ -1,22 +1,7 @@
import {
AsyncPipe,
NgFor,
NgIf,
} from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
Input,
OnInit,
} from '@angular/core';
import {
select,
Store,
} from '@ngrx/store';
import {
map,
Observable,
} from 'rxjs';
import { AsyncPipe, NgFor, NgIf, } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input, OnInit, } from '@angular/core';
import { select, Store, } from '@ngrx/store';
import { Observable, } from 'rxjs';
import { AuthService } from '../../core/auth/auth.service';
import { AuthMethod } from '../../core/auth/models/auth.method';
@@ -27,10 +12,13 @@ import {
isAuthenticationLoading,
} from '../../core/auth/selectors';
import { CoreState } from '../../core/core-state.model';
import { AuthMethodType } from '../../core/auth/models/auth.method-type';
import { map } from 'rxjs/operators';
import { hasValue } from '../empty.util';
import { ThemedLoadingComponent } from '../loading/themed-loading.component';
import { LogInContainerComponent } from './container/log-in-container.component';
import { rendersAuthMethodType } from './methods/log-in.methods-decorator';
import uniqBy from 'lodash/uniqBy';
@Component({
selector: 'ds-base-log-in',
@@ -48,6 +36,15 @@ export class LogInComponent implements OnInit {
*/
@Input() isStandalonePage: boolean;
/**
* Method to exclude from the list of authentication methods
*/
@Input() excludedAuthMethod: AuthMethodType;
/**
* Weather or not to show the register link
*/
@Input() showRegisterLink = true;
/**
* The list of authentication methods available
* @type {AuthMethod[]}
@@ -75,9 +72,13 @@ export class LogInComponent implements OnInit {
this.authMethods = this.store.pipe(
select(getAuthenticationMethods),
map((methods: AuthMethod[]) => methods
// ignore the given auth method if it should be excluded
.filter((authMethod: AuthMethod) => authMethod.authMethodType !== this.excludedAuthMethod)
.filter((authMethod: AuthMethod) => rendersAuthMethodType(authMethod.authMethodType) !== undefined)
.sort((method1: AuthMethod, method2: AuthMethod) => method1.position - method2.position),
),
// ignore the ip authentication method when it's returned by the backend
map((authMethods: AuthMethod[]) => uniqBy(authMethods.filter(a => a.authMethodType !== AuthMethodType.Ip), 'authMethodType'))
);
// set loading