improve auth by using sessions (refresh tokens)

This commit is contained in:
2026-07-02 22:39:58 +02:00
parent 0b2f042faa
commit 532f3f5faa
5 changed files with 169 additions and 35 deletions
+14
View File
@@ -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"`
}