feat(auth): Add /token endpoint to request a access token

This commit is contained in:
Björn Benouarets
2026-01-27 11:19:52 +01:00
parent 346100feb6
commit d8241a2491
19 changed files with 418 additions and 14 deletions

22
app/models/session.go Normal file
View File

@@ -0,0 +1,22 @@
package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type Session struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
UserID uuid.UUID `gorm:"type:uuid;not null" json:"user_id"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
User *User `gorm:"foreignKey:UserID" json:"user"`
}
func (Session) TableName() string {
return "sessions"
}