feat: login via passkey

This commit is contained in:
Jacky 2024-09-15 20:32:03 +08:00
parent 44c3180df7
commit bdfbbd0e8f
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
37 changed files with 1529 additions and 643 deletions

13
model/passkey.go Normal file
View file

@ -0,0 +1,13 @@
package model
import "github.com/go-webauthn/webauthn/webauthn"
type Passkey struct {
Model
Name string `json:"name"`
UserID int `json:"user_id"`
RawID string `json:"raw_id"`
Credential *webauthn.Credential `json:"-" gorm:"serializer:json"`
LastUsedAt int64 `json:"last_used_at" gorm:"default:0"`
}