Auth impl

This commit is contained in:
2024-01-07 15:52:23 +08:00
parent 632d614d1e
commit 69bae57473
6 changed files with 96 additions and 10 deletions

View File

@ -1,6 +1,10 @@
package models
import "time"
import (
"time"
"gorm.io/datatypes"
)
type AccountState = int8
@ -12,13 +16,14 @@ const (
type Account struct {
BaseModel
Name string `json:"name" gorm:"uniqueIndex"`
Nick string `json:"nick"`
State AccountState `json:"state"`
Session []AuthSession `json:"sessions"`
Challenges []AuthChallenge `json:"challenges"`
Factors []AuthFactor `json:"factors"`
Contacts []AccountContact `json:"contacts"`
Name string `json:"name" gorm:"uniqueIndex"`
Nick string `json:"nick"`
State AccountState `json:"state"`
Session []AuthSession `json:"sessions"`
Challenges []AuthChallenge `json:"challenges"`
Factors []AuthFactor `json:"factors"`
Contacts []AccountContact `json:"contacts"`
Permissions datatypes.JSONType[[]string] `json:"permissions"`
}
type AccountContactType = int8