Skip to content

Commit

Permalink
Use autoLogin method (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak authored Nov 29, 2024
1 parent 42040a6 commit 6ffc7e5
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -99,7 +98,7 @@ export class AutoregistrationComponent implements OnInit {
});

if (this.showAttributes.value === false) {
this.sendAutoLoginRequest();
this.autologin();
}
}

Expand All @@ -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 {
Expand Down

0 comments on commit 6ffc7e5

Please sign in to comment.