Skip to content

Commit

Permalink
fix: remove default overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Sep 30, 2024
1 parent f0c8e12 commit 03708bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
1 change: 1 addition & 0 deletions internal/api/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ func (a *API) verifyWebAuthnFactor(w http.ResponseWriter, r *http.Request, param

var webAuthn *webauthn.WebAuthn
var credential *webauthn.Credential
var err error

switch {
case params.WebAuthn == nil:
Expand Down
9 changes: 0 additions & 9 deletions internal/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,23 +935,14 @@ func (u *User) FindOwnedFactorByID(tx *storage.Connection, factorID uuid.UUID) (
}

func (user *User) WebAuthnID() []byte {
if webAuthnID, ok := user.UserMetaData["web_authn_id"].(string); ok && webAuthnID != "" {
return []byte(webAuthnID)
}
return []byte(user.ID.String())
}

func (user *User) WebAuthnName() string {
if webAuthnName, ok := user.UserMetaData["web_authn_name"].(string); ok && webAuthnName != "" {
return webAuthnName
}
return user.Email.String()
}

func (user *User) WebAuthnDisplayName() string {
if webAuthnDisplayName, ok := user.UserMetaData["web_authn_display_name"].(string); ok && webAuthnDisplayName != "" {
return webAuthnDisplayName
}
return user.Email.String()
}

Expand Down

0 comments on commit 03708bc

Please sign in to comment.