mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-10-07 18:22:04 +00:00
fix: library login fails
This commit is contained in:
+9
-7
@@ -16,25 +16,27 @@ import {Component} from '@angular/core';
|
||||
import {NavController} from '@ionic/angular';
|
||||
import {Router} from '@angular/router';
|
||||
import {AuthActions, IAuthAction} from 'ionic-appauth';
|
||||
import {SCAuthorizationProviderType} from '@openstapps/core';
|
||||
import {AuthHelperService} from '../../auth-helper.service';
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {Observable} from 'rxjs';
|
||||
import {IPAIAAuthAction} from '../../paia/paia-auth-action';
|
||||
import {DefaultAuthService} from '../../default-auth.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'auth-callback-page.component.html',
|
||||
styleUrls: ['auth-callback-page.component.scss'],
|
||||
})
|
||||
export class AuthCallbackPageComponent {
|
||||
PROVIDER_TYPE: SCAuthorizationProviderType = 'default';
|
||||
|
||||
constructor(private navCtrl: NavController, private router: Router, private authHelper: AuthHelperService) {
|
||||
const provider = this.authHelper.getProvider(this.PROVIDER_TYPE);
|
||||
const events: Observable<IPAIAAuthAction | IAuthAction> = provider.events$;
|
||||
constructor(
|
||||
private navCtrl: NavController,
|
||||
private router: Router,
|
||||
private authHelper: AuthHelperService,
|
||||
private auth: DefaultAuthService,
|
||||
) {
|
||||
const events: Observable<IPAIAAuthAction | IAuthAction> = this.auth.events$;
|
||||
|
||||
events.pipe(takeUntilDestroyed()).subscribe((action: IAuthAction) => this.postCallback(action));
|
||||
provider.authorizationCallback(window.location.origin + this.router.url);
|
||||
this.auth.authorizationCallback(window.location.origin + this.router.url);
|
||||
}
|
||||
|
||||
async postCallback(action: IAuthAction) {
|
||||
|
||||
Reference in New Issue
Block a user