Archived
Template
1
0

Various fixes (#5)

* Fixes #1

* Fixes #2

* Fixes #3

* Fixes #4
This commit is contained in:
Markus Tenghamn
2021-12-13 20:33:50 +01:00
committed by GitHub
parent c2493c238f
commit b5ba3d0387
234 changed files with 872 additions and 58627 deletions

View File

@ -19,6 +19,7 @@ func (controller Controller) ResetPassword(c *gin.Context) {
PageData: PageData{
Title: "Reset Password",
IsAuthenticated: isAuthenticated(c),
CacheParameter: controller.config.CacheParameter,
},
Token: token,
}
@ -34,6 +35,7 @@ func (controller Controller) ResetPasswordPost(c *gin.Context) {
PageData: PageData{
Title: "Reset Password",
IsAuthenticated: isAuthenticated(c),
CacheParameter: controller.config.CacheParameter,
},
Token: token,
}
@ -63,6 +65,15 @@ func (controller Controller) ResetPasswordPost(c *gin.Context) {
return
}
if forgotPasswordToken.HasExpired() {
pd.Messages = append(pd.Messages, Message{
Type: "error",
Content: resetError,
})
c.HTML(http.StatusBadRequest, "resetpassword.html", pd)
return
}
user := models.User{}
user.ID = uint(forgotPasswordToken.ModelID)
res = controller.db.Where(&user).First(&user)