feat: basic auth shit + db init

This commit is contained in:
hexlocation 2025-05-05 19:34:28 +02:00
parent db49da5fd9
commit d8caef7e5d
10 changed files with 261 additions and 69 deletions

32
internal/auth/types.go Normal file
View file

@ -0,0 +1,32 @@
package auth
import (
"gorm.io/gorm"
)
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn uint64 `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
Scope string `json:"scope"`
}
type User struct {
gorm.Model
ID string `json:"id" gorm:"primaryKey;autoIncrement:false"`
Username string `json:"username"`
Blacklisted bool
Email string `json:"email"`
}
type AvatarDecorationData struct {
Asset string
SkuID string
}
type ExchangeCodeRequest struct {
GrantType string `json:"grant_type"`
Code string `json:"code"`
RedirectUri string `json:"redirect_uri"`
}