mirror of
https://github.com/rishikanthc/Scriberr.git
synced 2026-06-30 15:57:01 +00:00
18 lines
623 B
Go
18 lines
623 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// RefreshToken represents a persistent refresh token for rotating access
|
|
type RefreshToken struct {
|
|
ID uint `json:"id" gorm:"primaryKey"`
|
|
UserID uint `json:"user_id" gorm:"not null;index"`
|
|
Hashed string `json:"-" gorm:"not null;uniqueIndex;type:varchar(128)"`
|
|
ExpiresAt time.Time `json:"expires_at" gorm:"not null;index"`
|
|
Revoked bool `json:"revoked" gorm:"not null;default:false;index"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
|
}
|
|
|