1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-22 14:57:35 +02:00

Add "last access" to access tokens

This commit is contained in:
binwiederhier 2023-01-28 20:29:06 -05:00
parent 000bf27c87
commit e596834096
15 changed files with 276 additions and 145 deletions

View file

@ -4,6 +4,7 @@ package user
import (
"errors"
"github.com/stripe/stripe-go/v74"
"net/netip"
"regexp"
"time"
)
@ -46,9 +47,17 @@ type Auther interface {
// Token represents a user token, including expiry date
type Token struct {
Value string
Label string
Expires time.Time
Value string
Label string
LastAccess time.Time
LastOrigin netip.Addr
Expires time.Time
}
// TokenUpdate holds information about the last access time and origin IP address of a token
type TokenUpdate struct {
LastAccess time.Time
LastOrigin netip.Addr
}
// Prefs represents a user's configuration settings