[server] Send error for unmet password requirements in reset

This commit is contained in:
Abhishek Shroff
2025-07-19 11:10:41 +05:30
parent 6cf0d0118b
commit 1d9eac4ef2

View File

@@ -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