feat: next
This commit is contained in:
33
server/internal/auth/user.go
Normal file
33
server/internal/auth/user.go
Normal file
@ -0,0 +1,33 @@
|
||||
package auth
|
||||
|
||||
import "github.com/go-webauthn/webauthn/webauthn"
|
||||
|
||||
type User struct {
|
||||
id string
|
||||
username string
|
||||
credentials []webauthn.Credential
|
||||
}
|
||||
|
||||
func NewUser(id string, username string, credentials []webauthn.Credential) User {
|
||||
return User{
|
||||
id: id,
|
||||
username: username,
|
||||
credentials: credentials,
|
||||
}
|
||||
}
|
||||
|
||||
func (u User) WebAuthnID() []byte {
|
||||
return []byte(u.id)
|
||||
}
|
||||
|
||||
func (u User) WebAuthnName() string {
|
||||
return u.username
|
||||
}
|
||||
|
||||
func (u User) WebAuthnDisplayName() string {
|
||||
return u.username
|
||||
}
|
||||
|
||||
func (u User) WebAuthnCredentials() []webauthn.Credential {
|
||||
return u.credentials
|
||||
}
|
Reference in New Issue
Block a user