16 lines
454 B
Go
16 lines
454 B
Go
package auth
|
|
|
|
import "time"
|
|
|
|
type RefreshToken struct {
|
|
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
|
|
UserID uint `json:"user_id" gorm:"not null;index"`
|
|
Token string `json:"token" gorm:"type:varchar(255);uniqueIndex;not null"`
|
|
ExpiresAt time.Time `json:"expires_at" gorm:"not null"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
|
}
|
|
|
|
func (RefreshToken) TableName() string {
|
|
return "refresh_tokens"
|
|
}
|