wip
This commit is contained in:
parent
144f033beb
commit
e848b548b5
7 changed files with 65 additions and 25 deletions
|
@ -13,9 +13,6 @@ export class AuthService {
|
|||
|
||||
private readonly authConfig: AuthConfig = {
|
||||
issuer: 'https://oauth.simonis.lol/application/o/casino-dev/',
|
||||
loginUrl: 'https://oauth.simonis.lol/application/o/authorize/',
|
||||
tokenEndpoint: 'https://oauth.simonis.lol/application/o/token/',
|
||||
userinfoEndpoint: 'https://oauth.simonis.lol/application/o/userinfo/',
|
||||
clientId: 'MDqjm1kcWKuZfqHJXjxwAV20i44aT7m4VhhTL3Nm',
|
||||
dummyClientSecret: 'GY2F8te6iAVYt1TNAUVLzWZEXb6JoMNp6chbjqaXNq4gS5xTDL54HqBiAlV1jFKarN28LQ7FUsYX4SbwjfEhZhgeoKuBnZKjR9eiu7RawnGgxIK9ffvUfMkjRxnmiGI5',
|
||||
scope: 'openid profile email',
|
||||
|
@ -25,6 +22,8 @@ export class AuthService {
|
|||
requestAccessToken: true,
|
||||
strictDiscoveryDocumentValidation: false,
|
||||
showDebugInformation: true,
|
||||
skipIssuerCheck: true,
|
||||
disableAtHashCheck: true,
|
||||
};
|
||||
|
||||
private isAuthenticated = new Subject<boolean>();
|
||||
|
@ -32,9 +31,11 @@ export class AuthService {
|
|||
private oauthService: OAuthService = inject(OAuthService);
|
||||
|
||||
constructor() {
|
||||
this.oauthService.setStorage(localStorage);
|
||||
this.oauthService.configure(this.authConfig);
|
||||
this.oauthService.events.subscribe((event) => {
|
||||
if (event.type === 'token_received') {
|
||||
localStorage.setItem('jwt', this.getAccessToken());
|
||||
this.oauthService.loadUserProfile().then((profile) => {
|
||||
this.fromUserProfile(profile).subscribe((user) => {
|
||||
this.user = user;
|
||||
|
@ -56,10 +57,6 @@ export class AuthService {
|
|||
this.isAuthenticated.next(false);
|
||||
}
|
||||
|
||||
getUserInfo() {
|
||||
return this.user;
|
||||
}
|
||||
|
||||
isLoggedIn() {
|
||||
return this.oauthService.hasValidAccessToken();
|
||||
}
|
||||
|
|
Reference in a new issue