diff --git a/storage/user.go b/storage/user.go index 440d5f6..0da6efc 100644 --- a/storage/user.go +++ b/storage/user.go @@ -267,10 +267,11 @@ func (s *Storage) FindAccountByPasskeyId(pkeyId []byte) (*Account, error) { log.Info(). Bytes("account-passkey-id", pkeyId). Msg("Local account with passkey id not found") + return nil, ErrEntryNotFound } else { log.Error().Err(res.Error).Bytes("account-passkey-id", pkeyId).Msg("Failed to get local account with passkey id") + return nil, res.Error } - return nil, res.Error } log.Info().Bytes("account-passkey-id", pkeyId).Msg("Found account, also inserting into cache") // if err = s.cache.Set(cacheUserIdToAccPrefix+acc.ID, &acc); err != nil { @@ -392,8 +393,8 @@ func (s *Storage) NewLocalAccount(handle string) (*Account, error) { } func (s *Storage) DeleteAccount(accId string) error { - // TODO: Implement me - panic("Not implemented") + defer util.Untrace(util.Trace(&log.Logger)) + return s.db.Delete(&Account{ID: accId}).Error } // ---- Section WebAuthn.User