feat: implement passkey registration flow

This commit is contained in:
Prad Nukala
2024-12-10 14:37:54 -05:00
parent b51c36645e
commit 04d929aae9
7 changed files with 32 additions and 35 deletions
+4 -19
View File
@@ -16,27 +16,12 @@ var (
ErrUserNotFound = echo.NewHTTPError(http.StatusNotFound, "User not found")
)
// Define the credential structure matching our frontend data
type Credential struct {
ID string `json:"id"`
RawID string `json:"rawId"`
Type string `json:"type"`
AuthenticatorAttachment string `json:"authenticatorAttachment"`
Transports []string `json:"transports"`
ClientExtensionResults map[string]interface{} `json:"clientExtensionResults"`
Response struct {
AttestationObject string `json:"attestationObject"`
ClientDataJSON string `json:"clientDataJSON"`
} `json:"response"`
}
type User struct {
gorm.Model
Address string `json:"address"`
Handle string `json:"handle"`
Name string `json:"name"`
CID string `json:"cid"`
Credentials []*Credential `json:"credentials"`
Address string `json:"address"`
Handle string `json:"handle"`
Name string `json:"name"`
CID string `json:"cid"`
}
type Session struct {
-1
View File
@@ -20,7 +20,6 @@ func NewGormDB(env config.Env) (*gorm.DB, error) {
// Migrate the schema
db.AutoMigrate(&Session{})
db.AutoMigrate(&User{})
return db, nil
}