fix: avoid parsing access token on frontend during login (#1201)
This commit is contained in:
@@ -164,7 +164,7 @@ describe('LoginComponent', () => {
|
||||
|
||||
it('navigates to change-password when the server marks the password as default', () => {
|
||||
configureComponent();
|
||||
authService.internalLogin.mockReturnValue(of({isDefaultPassword: 'true'}));
|
||||
authService.internalLogin.mockReturnValue(of({isDefaultPassword: true}));
|
||||
|
||||
component.username = 'admin';
|
||||
component.password = 'password';
|
||||
@@ -175,7 +175,7 @@ describe('LoginComponent', () => {
|
||||
|
||||
it('navigates to the dashboard after a successful non-default-password login', () => {
|
||||
configureComponent();
|
||||
authService.internalLogin.mockReturnValue(of({isDefaultPassword: 'false'}));
|
||||
authService.internalLogin.mockReturnValue(of({isDefaultPassword: false}));
|
||||
|
||||
component.username = 'admin';
|
||||
component.password = 'password';
|
||||
|
||||
@@ -126,7 +126,7 @@ export class LoginComponent implements OnInit {
|
||||
login(): void {
|
||||
this.authService.internalLogin({username: this.username, password: this.password}).subscribe({
|
||||
next: (response) => {
|
||||
if (response.isDefaultPassword === 'true') {
|
||||
if (response.isDefaultPassword) {
|
||||
this.router.navigate(['/change-password']);
|
||||
} else {
|
||||
this.router.navigate(['/dashboard']);
|
||||
|
||||
Reference in New Issue
Block a user