linstrom/storage-new/models/UserAuthentication.go
mstar ef91558600
Some checks are pending
/ test (push) Waiting to run
Comments, fixes
2025-04-01 17:24:06 +02:00

19 lines
557 B
Go

package models
import "gorm.io/gorm"
// One authentication method linked to one account.
// Contains the method and whatever the token may be
// For a password, this would be a hash of that password,
// totp would be the seed,
// and passkey would be the webauthn.Credential, marshalled into json
//
// Password hashes may only exist at most once per user, the rest 0-m
type UserAuthMethod struct {
gorm.Model
User User
UserId string
AuthMethod AuthenticationMethodType `gorm:"type:auth_method_type"`
Token []byte
Name string
}