add new user defined user exiration

This commit is contained in:
Adrian Zürcher
2025-11-07 13:51:58 +01:00
parent 296c2e001d
commit 0506ed6491
2 changed files with 49 additions and 10 deletions

View File

@@ -15,3 +15,17 @@ type User struct {
func (u *User) IsValid() bool {
return u.Name != ""
}
func (u *User) ExpirationIsValid() bool {
if u.Expiration == nil {
return true
}
return time.Now().Before(*u.Expiration)
}
func (u *User) GetExpiration() string {
if u.Expiration == nil {
return ""
}
return u.Expiration.Format(time.RFC3339)
}