Archived
Template
1
0

Adds godoc comments

This commit is contained in:
uberswe
2022-01-09 14:22:43 +01:00
parent 2d3c0df4e5
commit 8c37faf016
30 changed files with 154 additions and 68 deletions

View File

@ -5,6 +5,7 @@ import (
"time"
)
// Token holds tokens typically used for user activation and password resets
type Token struct {
gorm.Model
Value string
@ -14,11 +15,14 @@ type Token struct {
ExpiresAt time.Time
}
// HasExpired is a helper function that checks if the current time is after the token expiration time
func (t Token) HasExpired() bool {
return t.ExpiresAt.Before(time.Now())
}
const (
// TokenUserActivation is a constant used to identify tokens used for user activation
TokenUserActivation string = "user_activation"
TokenPasswordReset string = "password_reset"
// TokenPasswordReset is a constant used to identify tokens used for password resets
TokenPasswordReset string = "password_reset"
)