From ab4ff29407a8736ee83312f45f06c6fe476d3606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Wed, 24 May 2023 09:39:24 +0100 Subject: [PATCH] fix: hide password login when it's disabled (#3851) https://linear.app/unleash/issue/2-1085/bug-password-based-login-still-shows-on-the-login-page-even-if Fixes a regression introduced with the changes related with #3633 where we still show the password login even though it's disabled. --------- Co-authored-by: Thomas Heartman --- src/lib/error/unleash-error.test.ts | 1 + src/lib/types/authentication-required.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib/error/unleash-error.test.ts b/src/lib/error/unleash-error.test.ts index 2df0727b0e..3369d10840 100644 --- a/src/lib/error/unleash-error.test.ts +++ b/src/lib/error/unleash-error.test.ts @@ -374,6 +374,7 @@ describe('Error serialization special cases', () => { type: 'password', path: `base-path/auth/simple/login`, message: 'You must sign in order to use Unleash', + defaultHidden: true, options: [ { type: 'google', diff --git a/src/lib/types/authentication-required.ts b/src/lib/types/authentication-required.ts index 9efd6579b4..b9887ac165 100644 --- a/src/lib/types/authentication-required.ts +++ b/src/lib/types/authentication-required.ts @@ -39,6 +39,7 @@ class AuthenticationRequired extends UnleashError { ...super.toJSON(), path: this.path, type: this.type, + defaultHidden: this.defaultHidden, ...(this.options ? { options: this.options } : {}), }; }