Fix (account): return error, implement deletion
Fixed returning the wrong error if an account isn't found in a passkey id request Implemented account deletion
This commit is contained in:
parent
575392d6d4
commit
487b57b4d6
1 changed files with 4 additions and 3 deletions
|
@ -267,10 +267,11 @@ func (s *Storage) FindAccountByPasskeyId(pkeyId []byte) (*Account, error) {
|
||||||
log.Info().
|
log.Info().
|
||||||
Bytes("account-passkey-id", pkeyId).
|
Bytes("account-passkey-id", pkeyId).
|
||||||
Msg("Local account with passkey id not found")
|
Msg("Local account with passkey id not found")
|
||||||
|
return nil, ErrEntryNotFound
|
||||||
} else {
|
} else {
|
||||||
log.Error().Err(res.Error).Bytes("account-passkey-id", pkeyId).Msg("Failed to get local account with passkey id")
|
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")
|
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 {
|
// 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 {
|
func (s *Storage) DeleteAccount(accId string) error {
|
||||||
// TODO: Implement me
|
defer util.Untrace(util.Trace(&log.Logger))
|
||||||
panic("Not implemented")
|
return s.db.Delete(&Account{ID: accId}).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- Section WebAuthn.User
|
// ---- Section WebAuthn.User
|
||||||
|
|
Loading…
Reference in a new issue