Bugfix/fix biometric authentication registration (#2713)
* Remove token on device registration * Update changelog
This commit is contained in:
parent
c85966e5ed
commit
833982a9de
@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Improved the language localization for Türkçe (`tr`)
|
- Improved the language localization for Türkçe (`tr`)
|
||||||
- Upgraded `ng-extract-i18n-merge` from version `2.8.3` to `2.9.0`
|
- Upgraded `ng-extract-i18n-merge` from version `2.8.3` to `2.9.0`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue in the biometric authentication registration
|
||||||
|
|
||||||
## 2.28.0 - 2023-12-02
|
## 2.28.0 - 2023-12-02
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -15,7 +15,7 @@ import { LoginWithAccessTokenDialog } from '@ghostfolio/client/components/login-
|
|||||||
import { DataService } from '@ghostfolio/client/services/data.service';
|
import { DataService } from '@ghostfolio/client/services/data.service';
|
||||||
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
|
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
|
||||||
import {
|
import {
|
||||||
STAY_SIGNED_IN,
|
KEY_STAY_SIGNED_IN,
|
||||||
SettingsStorageService
|
SettingsStorageService
|
||||||
} from '@ghostfolio/client/services/settings-storage.service';
|
} from '@ghostfolio/client/services/settings-storage.service';
|
||||||
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
|
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
|
||||||
@ -196,7 +196,7 @@ export class HeaderComponent implements OnChanges {
|
|||||||
public setToken(aToken: string) {
|
public setToken(aToken: string) {
|
||||||
this.tokenStorageService.saveToken(
|
this.tokenStorageService.saveToken(
|
||||||
aToken,
|
aToken,
|
||||||
this.settingsStorageService.getSetting(STAY_SIGNED_IN) === 'true'
|
this.settingsStorageService.getSetting(KEY_STAY_SIGNED_IN) === 'true'
|
||||||
);
|
);
|
||||||
|
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
|
@ -4,7 +4,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { InternetIdentityService } from '@ghostfolio/client/services/internet-identity.service';
|
import { InternetIdentityService } from '@ghostfolio/client/services/internet-identity.service';
|
||||||
import {
|
import {
|
||||||
STAY_SIGNED_IN,
|
KEY_STAY_SIGNED_IN,
|
||||||
SettingsStorageService
|
SettingsStorageService
|
||||||
} from '@ghostfolio/client/services/settings-storage.service';
|
} from '@ghostfolio/client/services/settings-storage.service';
|
||||||
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
|
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
|
||||||
@ -31,7 +31,7 @@ export class LoginWithAccessTokenDialog {
|
|||||||
|
|
||||||
public onChangeStaySignedIn(aValue: MatCheckboxChange) {
|
public onChangeStaySignedIn(aValue: MatCheckboxChange) {
|
||||||
this.settingsStorageService.setSetting(
|
this.settingsStorageService.setSetting(
|
||||||
STAY_SIGNED_IN,
|
KEY_STAY_SIGNED_IN,
|
||||||
aValue.checked?.toString()
|
aValue.checked?.toString()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,8 @@ import {
|
|||||||
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||||
import { DataService } from '@ghostfolio/client/services/data.service';
|
import { DataService } from '@ghostfolio/client/services/data.service';
|
||||||
import {
|
import {
|
||||||
STAY_SIGNED_IN,
|
KEY_STAY_SIGNED_IN,
|
||||||
|
KEY_TOKEN,
|
||||||
SettingsStorageService
|
SettingsStorageService
|
||||||
} from '@ghostfolio/client/services/settings-storage.service';
|
} from '@ghostfolio/client/services/settings-storage.service';
|
||||||
import { UserService } from '@ghostfolio/client/services/user/user.service';
|
import { UserService } from '@ghostfolio/client/services/user/user.service';
|
||||||
@ -241,7 +242,8 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
this.settingsStorageService.removeSetting(STAY_SIGNED_IN);
|
this.settingsStorageService.removeSetting(KEY_STAY_SIGNED_IN);
|
||||||
|
this.settingsStorageService.removeSetting(KEY_TOKEN);
|
||||||
|
|
||||||
this.update();
|
this.update();
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import {
|
import {
|
||||||
STAY_SIGNED_IN,
|
KEY_STAY_SIGNED_IN,
|
||||||
SettingsStorageService
|
SettingsStorageService
|
||||||
} from '@ghostfolio/client/services/settings-storage.service';
|
} from '@ghostfolio/client/services/settings-storage.service';
|
||||||
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
|
import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service';
|
||||||
@ -31,7 +31,7 @@ export class AuthPageComponent implements OnDestroy, OnInit {
|
|||||||
|
|
||||||
this.tokenStorageService.saveToken(
|
this.tokenStorageService.saveToken(
|
||||||
jwt,
|
jwt,
|
||||||
this.settingsStorageService.getSetting(STAY_SIGNED_IN) === 'true'
|
this.settingsStorageService.getSetting(KEY_STAY_SIGNED_IN) === 'true'
|
||||||
);
|
);
|
||||||
|
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
export const RANGE = 'range';
|
export const KEY_RANGE = 'range';
|
||||||
export const STAY_SIGNED_IN = 'staySignedIn';
|
export const KEY_STAY_SIGNED_IN = 'staySignedIn';
|
||||||
|
export const KEY_TOKEN = 'auth-token';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service';
|
import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service';
|
||||||
|
|
||||||
|
import { KEY_TOKEN } from './settings-storage.service';
|
||||||
import { UserService } from './user/user.service';
|
import { UserService } from './user/user.service';
|
||||||
|
|
||||||
const TOKEN_KEY = 'auth-token';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@ -16,16 +15,16 @@ export class TokenStorageService {
|
|||||||
|
|
||||||
public getToken(): string {
|
public getToken(): string {
|
||||||
return (
|
return (
|
||||||
window.sessionStorage.getItem(TOKEN_KEY) ||
|
window.sessionStorage.getItem(KEY_TOKEN) ||
|
||||||
window.localStorage.getItem(TOKEN_KEY)
|
window.localStorage.getItem(KEY_TOKEN)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveToken(token: string, staySignedIn = false): void {
|
public saveToken(token: string, staySignedIn = false): void {
|
||||||
if (staySignedIn) {
|
if (staySignedIn) {
|
||||||
window.localStorage.setItem(TOKEN_KEY, token);
|
window.localStorage.setItem(KEY_TOKEN, token);
|
||||||
}
|
}
|
||||||
window.sessionStorage.setItem(TOKEN_KEY, token);
|
window.sessionStorage.setItem(KEY_TOKEN, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public signOut(): void {
|
public signOut(): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user