Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webapp): the initial 401 error is shown when it should not #1102

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions webapp/src/client/app/modules/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';

Expand Down Expand Up @@ -76,8 +77,8 @@ export class LoginComponent extends BaseComponent implements OnInit {
}
}

private handleAutoLoginError(error): Observable<boolean> {
if (error.status && error.status !== '401') {
private handleAutoLoginError(error: HttpErrorResponse): Observable<boolean> {
if (error?.status !== 401) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's an integer instead of a string

rxjs catch error does not infer the type of the error

console.error('Auto login:', error);
this.addMessages([
{
Expand Down