mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-16 00:51:19 -06:00
[server] Send error for unmet password requirements in reset
This commit is contained in:
@@ -241,6 +241,9 @@ func loginAndSendResponse(c *gin.Context, loginFn func(db.TxHandler) (auth.Auth,
|
||||
if errors.Is(err, auth.ErrTokenInvalid) {
|
||||
return core.NewError(http.StatusUnauthorized, "token_invalid", "token invalid")
|
||||
}
|
||||
if e, ok := err.(*auth.PasswordRequirementsError); ok {
|
||||
panic(core.NewError(http.StatusBadRequest, "new_password_invalid", e.Error()))
|
||||
}
|
||||
return err
|
||||
} else if r, err := user.Bootstrap(c.Request.Context(), a, 0); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user