API Errors: Hide and log internal errors (#411)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-09-23 08:10:27 -07:00
1 parent ac9a7735e1
commit 2f8d7f0a32
27 files changed
+1465 -1205

No files matched your search

@@ -101,8 +101,9 @@ func (r *Repository) Authenticate(ctx context.Context, scopeId, authMethodId, lo
// the stored password. The account for the accountId is returned with a
// new CredentialId if password is successfully changed.
//
// Returns nil if old does not match the stored password for accountId.
// Returns ErrPasswordsEqual if old and new are equal.
// Returns nil, db.ErrorRecordNotFound if the account doesn't exist.
// Returns nil, nil if old does not match the stored password for accountId.
// Returns nil, ErrPasswordsEqual if old and new are equal.
func (r *Repository) ChangePassword(ctx context.Context, scopeId, accountId, old, new string, version uint32) (*Account, error) {
if accountId == "" {
return nil, fmt.Errorf("change password: no account id: %w", db.ErrInvalidParameter)