diff --git a/client/src/components/Login/LoginForm.vue b/client/src/components/Login/LoginForm.vue index 4ad09ebb0d57..08988c888f5c 100644 --- a/client/src/components/Login/LoginForm.vue +++ b/client/src/components/Login/LoginForm.vue @@ -97,7 +97,7 @@ async function submitLogin() { } if (response.data.expired_user) { - window.location.href = withPrefix(`/root/login?expired_user=${response.data.expired_user}`); + window.location.href = withPrefix(`/login/start?expired_user=${response.data.expired_user}`); } else if (connectExternalProvider.value) { window.location.href = withPrefix("/user/external_ids?connect_external=true"); } else if (response.data.redirect) { @@ -125,20 +125,6 @@ function setRedirect(url: string) { localStorage.setItem("redirect_url", url); } -async function resetLogin() { - loading.value = true; - try { - const response = await axios.post(withPrefix("/user/reset_password"), { email: login.value }); - messageVariant.value = "info"; - messageText.value = response.data.message; - } catch (e) { - messageVariant.value = "danger"; - messageText.value = errorMessageAsString(e, "Password reset failed for an unknown reason."); - } finally { - loading.value = false; - } -} - function returnToLogin() { router.push("/login/start"); } @@ -205,7 +191,7 @@ function returnToLogin() { v-localize href="javascript:void(0)" role="button" - @click.prevent="resetLogin"> + @click.prevent="router.push('/login/reset_password')"> Click here to reset your password. diff --git a/client/src/entry/analysis/modules/ResetPassword.vue b/client/src/entry/analysis/modules/ResetPassword.vue new file mode 100644 index 000000000000..3078e87e5ac8 --- /dev/null +++ b/client/src/entry/analysis/modules/ResetPassword.vue @@ -0,0 +1,47 @@ + + + + + + + + {{ message }} + + + + + + + + Reset your password + + + + + diff --git a/client/src/entry/analysis/router.js b/client/src/entry/analysis/router.js index 9615f6e299d2..d59a32094b3d 100644 --- a/client/src/entry/analysis/router.js +++ b/client/src/entry/analysis/router.js @@ -45,6 +45,7 @@ import Analysis from "entry/analysis/modules/Analysis"; import CenterFrame from "entry/analysis/modules/CenterFrame"; import Home from "entry/analysis/modules/Home"; import Login from "entry/analysis/modules/Login"; +import ResetPassword from "entry/analysis/modules/ResetPassword"; import WorkflowEditorModule from "entry/analysis/modules/WorkflowEditor"; import AdminRoutes from "entry/analysis/routes/admin-routes"; import LibraryRoutes from "entry/analysis/routes/library-routes"; @@ -121,6 +122,12 @@ export function getRouter(Galaxy) { component: Login, redirect: redirectLoggedIn(), }, + /** Login entry route */ + { + path: "/login/reset_password", + component: ResetPassword, + redirect: redirectLoggedIn(), + }, /** Page editor */ { path: "/pages/editor",