base 64 decode password

This commit is contained in:
GotPPay
2018-06-01 19:29:17 +02:00
parent 2fc6619383
commit 3494273503

View File

@@ -118,6 +118,12 @@ func (c *controller) handleResetComplete(ctx echo.Context) error {
return routeutils.ResponseAPIPasswordResetFailed(ctx, "No password")
}
pass, err := b64.StdEncoding.DecodeString(user.Pass)
if err != nil {
return routeutils.ResponseAPIPasswordResetFailed(ctx, "Invalid password", false)
}
user.Pass = string(pass)
passwordResetEntry, err := c.svc.PasswordReset.GetByToken(userToken)
if err != nil || len(passwordResetEntry.Token) < 1 || passwordResetEntry.Expires.Before(time.Now()) || passwordResetEntry.Used == true {
return routeutils.ResponseAPIPasswordResetFailed(ctx, "Token error")