1
0

Fix password reset without a reseet token

This commit is contained in:
kolaente
2020-12-30 21:43:14 +01:00
parent c842b70cb5
commit 787044628f
3 changed files with 12 additions and 2 deletions

View File

@ -157,6 +157,12 @@ func (err ErrNoPasswordResetToken) HTTPError() web.HTTPError {
return web.HTTPError{HTTPCode: http.StatusPreconditionFailed, Code: ErrCodeNoPasswordResetToken, Message: "No token to reset a user's password provided."}
}
// IsErrNoPasswordResetToken checks if an error is ErrNoPasswordResetToken
func IsErrNoPasswordResetToken(err error) bool {
_, ok := err.(ErrNoPasswordResetToken)
return ok
}
// ErrInvalidPasswordResetToken is an error where the password reset token is invalid
type ErrInvalidPasswordResetToken struct {
Token string