Skip to content

Commit

Permalink
Allow logged-in users to reset their password
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nono committed Jul 16, 2024
1 parent 55c3dd8 commit dfb636d
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions web/auth/passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit dfb636d

Please sign in to comment.