From 06b05b006ed7d22a69282d5dfae80c420e122b53 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 24 Dec 2020 13:24:50 +0900 Subject: settings page, experiments tweaks --- src/app/import-attributes/import-attributes.component.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/app/import-attributes/import-attributes.component.ts') diff --git a/src/app/import-attributes/import-attributes.component.ts b/src/app/import-attributes/import-attributes.component.ts index 4f610cb..3194490 100644 --- a/src/app/import-attributes/import-attributes.component.ts +++ b/src/app/import-attributes/import-attributes.component.ts @@ -10,7 +10,7 @@ import { IdProvider } from '../idProvider'; import { LoginOptions } from 'angular-oauth2-oidc'; import { Scope } from '../scope'; import { LanguageService } from '../language.service'; - +import { ConfigService } from '../config.service'; @Component({ selector: 'app-import-attributes', @@ -37,7 +37,8 @@ export class ImportAttributesComponent implements OnInit { private router: Router, private credentialService: CredentialService, private oauthService: OAuthService, - private languageService: LanguageService) { } + private languageService: LanguageService, + private configService: ConfigService) { } ngOnInit(): void { @@ -124,8 +125,12 @@ export class ImportAttributesComponent implements OnInit { this.discoveringIdProvider = true; localStorage.setItem('userForCredential', this.identity.name); let account = this.webfingerEmail; - if (this.webfingerEmail.substr(this.webfingerEmail.indexOf('@')+1) === 'aisec.fraunhofer.de') { - account = this.webfingerEmail.substr(0, this.webfingerEmail.indexOf('@')+1) + 'as.aisec.fraunhofer.de'; + if (this.configService.get().experiments) { + if (this.webfingerEmail.substr(this.webfingerEmail.indexOf('@')+1) === 'aisec.fraunhofer.de') { + account = this.webfingerEmail.substr(0, this.webfingerEmail.indexOf('@')+1) + 'as.aisec.fraunhofer.de'; + } else if (this.webfingerEmail.substr(this.webfingerEmail.indexOf('@')+1) === 'bfh.ch') { + account = this.webfingerEmail.substr(0, this.webfingerEmail.indexOf('@')+1) + 'omejdn.nslab.ch'; + } } this.credentialService.getLink(account).subscribe (idProvider => { -- cgit v1.2.3