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,11 +267,12 @@ 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
|
||||
}
|
||||
}
|
||||
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 {
|
||||
// log.Warn().
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue