From b54a666776420106bb694d08700e7ae234b9ab51 Mon Sep 17 00:00:00 2001 From: "irvingouj @ Devolutions" Date: Mon, 11 Nov 2024 18:23:41 -0500 Subject: [PATCH] fix(webapp): the initial 401 error is shown when it should not (#1102) Issue: DGW-226 --- webapp/src/client/app/modules/login/login.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/src/client/app/modules/login/login.component.ts b/webapp/src/client/app/modules/login/login.component.ts index 7fb2cfd72..84c09f4bf 100644 --- a/webapp/src/client/app/modules/login/login.component.ts +++ b/webapp/src/client/app/modules/login/login.component.ts @@ -1,3 +1,4 @@ +import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; @@ -76,8 +77,8 @@ export class LoginComponent extends BaseComponent implements OnInit { } } - private handleAutoLoginError(error): Observable { - if (error.status && error.status !== '401') { + private handleAutoLoginError(error: HttpErrorResponse): Observable { + if (error?.status !== 401) { console.error('Auto login:', error); this.addMessages([ {