From f3ef7455ab2e38504dd0666e773c3f2357c9c316 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Mon, 20 Jan 2020 16:42:23 +0100 Subject: [PATCH 1/2] Do not render password change if authenticating --- src/auth/index.tsx | 13 +++++++++++-- src/index.tsx | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/auth/index.tsx b/src/auth/index.tsx index 4a5f92c2f..e57a0159b 100644 --- a/src/auth/index.tsx +++ b/src/auth/index.tsx @@ -12,6 +12,7 @@ import LoginView from "./views/Login"; import NewPassword from "./views/NewPassword"; import ResetPassword from "./views/ResetPassword"; import ResetPasswordSuccess from "./views/ResetPasswordSuccess"; +import LoginLoading from "./components/LoginLoading"; interface UserContext { login: (username: string, password: string) => void; @@ -30,12 +31,20 @@ export const UserContext = React.createContext({ tokenVerifyLoading: false }); -const AuthRouter: React.FC = () => ( +interface AuthRouterProps { + hasToken: boolean; +} + +const AuthRouter: React.FC = ({ hasToken }) => ( - + {!hasToken ? ( + + ) : ( + + )} diff --git a/src/index.tsx b/src/index.tsx index 915593649..9339671bf 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -275,7 +275,7 @@ const Routes: React.FC = () => { ) : hasToken && tokenVerifyLoading ? ( ) : ( - + ) } From b74f2c5df14b66e764e106253a19fddb6f01feab Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Mon, 20 Jan 2020 16:44:00 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 078f89eea..6e6250a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ All notable, unreleased changes to this project will be documented in this file. - Stop using deprecated fields - #357 by @dominik-zeglen - Throw error when API_URI is not set - #375 by @dominik-zeglen - Fix variant stock input - #377 by @dominik-zeglen +- Do not render password change if authenticating - #378 by @dominik-zeglen ## 2.0.0