From dfb636def17da06dfef8e6c49e3fdcc4f5e1bd59 Mon Sep 17 00:00:00 2001 From: Bruno Michel Date: Tue, 16 Jul 2024 17:29:08 +0200 Subject: [PATCH] Allow logged-in users to reset their password Users with OIDC can have a password for their vault, and if they forgot it, they should be able to reset it. The path to do that makes them logged-in (via OIDC) when the passwor is renewed. --- web/auth/passphrase.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/web/auth/passphrase.go b/web/auth/passphrase.go index eb45d70b9fe..91c4ec9ac46 100644 --- a/web/auth/passphrase.go +++ b/web/auth/passphrase.go @@ -156,10 +156,6 @@ func passphraseReset(c echo.Context) error { func passphraseRenewForm(c echo.Context) error { inst := middlewares.GetInstance(c) - if middlewares.IsLoggedIn(c) { - redirect := inst.DefaultRedirection().String() - return c.Redirect(http.StatusSeeOther, redirect) - } // Check that the token is actually defined and well encoded. The actual // token value checking is also done on the passphraseRenew handler. @@ -200,13 +196,6 @@ func passphraseRenewForm(c echo.Context) error { func passphraseRenew(c echo.Context) error { inst := middlewares.GetInstance(c) - if middlewares.IsLoggedIn(c) { - redirect := inst.DefaultRedirection().String() - if wantsJSON(c) { - return c.JSON(http.StatusOK, echo.Map{"redirect": redirect}) - } - return c.Redirect(http.StatusSeeOther, redirect) - } pass := []byte(c.FormValue("passphrase")) iterations, _ := strconv.Atoi(c.FormValue("iterations")) token, err := hex.DecodeString(c.FormValue("passphrase_reset_token"))