You've already forked golang-base-project
@ -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)
|
||||
|
Reference in New Issue
Block a user