You've already forked golang-base-project
@ -14,6 +14,7 @@ func (controller Controller) Activate(c *gin.Context) {
|
||||
pd := PageData{
|
||||
Title: "Activate",
|
||||
IsAuthenticated: isAuthenticated(c),
|
||||
CacheParameter: controller.config.CacheParameter,
|
||||
}
|
||||
token := c.Param("token")
|
||||
activationToken := models.Token{
|
||||
@ -32,6 +33,15 @@ func (controller Controller) Activate(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if activationToken.HasExpired() {
|
||||
pd.Messages = append(pd.Messages, Message{
|
||||
Type: "error",
|
||||
Content: activationError,
|
||||
})
|
||||
c.HTML(http.StatusBadRequest, "activate.html", pd)
|
||||
return
|
||||
}
|
||||
|
||||
user := models.User{}
|
||||
user.ID = uint(activationToken.ModelID)
|
||||
|
||||
|
Reference in New Issue
Block a user