mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
@@ -24,6 +24,7 @@ import {
|
||||
SCAuthorizationProviderType,
|
||||
SCUserConfiguration,
|
||||
} from '@openstapps/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -36,6 +37,8 @@ export class ProfilePageComponent implements OnInit, OnDestroy {
|
||||
paia: {loggedIn: false},
|
||||
};
|
||||
|
||||
originPath: string | null;
|
||||
|
||||
userInfo?: SCUserConfiguration;
|
||||
|
||||
subscriptions: Subscription[] = [];
|
||||
@@ -44,7 +47,8 @@ export class ProfilePageComponent implements OnInit, OnDestroy {
|
||||
private defaultAuth: DefaultAuthService,
|
||||
private paiaAuth: PAIAAuthService,
|
||||
private requestor: Requestor,
|
||||
private authHelperService: AuthHelperService,
|
||||
private authHelper: AuthHelperService,
|
||||
private route: ActivatedRoute,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -70,6 +74,9 @@ export class ProfilePageComponent implements OnInit, OnDestroy {
|
||||
this.data.paia.loggedIn = false;
|
||||
});
|
||||
}),
|
||||
this.route.queryParamMap.subscribe(queryParams => {
|
||||
this.originPath = queryParams.get('origin_path');
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -79,15 +86,17 @@ export class ProfilePageComponent implements OnInit, OnDestroy {
|
||||
userInfoHandler
|
||||
.performUserInfoRequest(this.defaultAuth.localConfiguration, token)
|
||||
.then(userInfo => {
|
||||
this.userInfo = this.authHelperService.getUserFromUserInfo(userInfo);
|
||||
this.userInfo = this.authHelper.getUserFromUserInfo(userInfo);
|
||||
});
|
||||
}
|
||||
|
||||
public signIn() {
|
||||
async signIn() {
|
||||
await this.handleOriginPath();
|
||||
this.defaultAuth.signIn();
|
||||
}
|
||||
|
||||
signInPAIA() {
|
||||
async signInPAIA() {
|
||||
await this.handleOriginPath();
|
||||
this.paiaAuth.signIn();
|
||||
}
|
||||
|
||||
@@ -105,4 +114,10 @@ export class ProfilePageComponent implements OnInit, OnDestroy {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
private async handleOriginPath() {
|
||||
this.originPath
|
||||
? await this.authHelper.setOriginPath(this.originPath)
|
||||
: await this.authHelper.deleteOriginPath();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user