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

@ -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)