feat: impl refresh token rotation

This commit is contained in:
2025-12-03 00:07:39 +00:00
parent a7bdc831ea
commit 3a6fafacca
8 changed files with 259 additions and 56 deletions

View File

@@ -0,0 +1,22 @@
package auth
import (
"time"
"github.com/google/uuid"
"github.com/uptrace/bun"
)
type Grant struct {
bun.BaseModel `bun:"grants"`
ID uuid.UUID `bun:",pk,type:uuid"`
UserID uuid.UUID `bun:"user_id,notnull"`
CreatedAt time.Time `bun:"created_at,notnull,nullzero"`
UpdatedAt time.Time `bun:"updated_at,notnull,nullzero"`
RevokedAt *time.Time `bun:"revoked_at,nullzero"`
}
func newGrantID() (uuid.UUID, error) {
return uuid.NewV7()
}