From 6ffc7e510cc367a89717f102a33054f2004f056e Mon Sep 17 00:00:00 2001 From: milanmajchrak <90026355+milanmajchrak@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:02:18 +0100 Subject: [PATCH] Use `autoLogin` method (#747) --- .../autoregistration/autoregistration.component.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/login-page/autoregistration/autoregistration.component.ts b/src/app/login-page/autoregistration/autoregistration.component.ts index 10bc546fb60..c0821e5b9d2 100644 --- a/src/app/login-page/autoregistration/autoregistration.component.ts +++ b/src/app/login-page/autoregistration/autoregistration.component.ts @@ -22,7 +22,6 @@ import { HttpHeaders } from '@angular/common/http'; import { AuthTokenInfo } from '../../core/auth/models/auth-token-info.model'; import { isEmpty } from '../../shared/empty.util'; import { CoreState } from 'src/app/core/core-state.model'; -import { hasSucceeded } from 'src/app/core/data/request-entry-state.model'; import { FindListOptions } from '../../core/data/find-list-options.model'; import { getBaseUrl } from '../../shared/clarin-shared-util'; import { ConfigurationProperty } from '../../core/shared/configuration-property.model'; @@ -99,7 +98,7 @@ export class AutoregistrationComponent implements OnInit { }); if (this.showAttributes.value === false) { - this.sendAutoLoginRequest(); + this.autologin(); } } @@ -119,11 +118,9 @@ export class AutoregistrationComponent implements OnInit { const response = this.rdbService.buildFromRequestUUID(requestId); // Process response response - .pipe(getFirstCompletedRemoteData()) + .pipe(getFirstSucceededRemoteData()) .subscribe(responseRD$ => { - if (hasSucceeded(responseRD$.state)) { - // Show successful message - this.notificationService.success(this.translateService.instant('clarin.autoregistration.successful.message')); + if (responseRD$.hasSucceeded) { // Call autologin this.sendAutoLoginRequest(); } else {