improve auth by using sessions (refresh tokens)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
Uuid uuid.UUID `json:"uuid" gorm:"type:uuid;primaryKey"`
|
||||
UserUuid uuid.UUID `json:"user_uuid" gorm:"not null"`
|
||||
HashedRefreshToken string `json:"-" gorm:"not null;unique"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Revoked bool `json:"revoked"`
|
||||
}
|
||||
Reference in New Issue
Block a user