Skip to content

Commit

Permalink
consent: Ignore row count in revoke (#1173)
Browse files Browse the repository at this point in the history
Closes #1168

Signed-off-by: arekkas <[email protected]>
  • Loading branch information
aeneasr authored and arekkas committed Nov 18, 2018
1 parent ea89c47 commit 4665ebd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions consent/manager_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ WHERE challenge IN (SELECT r.challenge FROM hydra_oauth2_consent_request as r WH
}

func (m *SQLManager) RevokeUserAuthenticationSession(ctx context.Context, user string) error {
rows, err := m.db.ExecContext(
_, err := m.db.ExecContext(
ctx,
m.db.Rebind("DELETE FROM hydra_oauth2_authentication_session WHERE subject=?"),
user,
Expand All @@ -147,10 +147,13 @@ func (m *SQLManager) RevokeUserAuthenticationSession(ctx context.Context, user s
return sqlcon.HandleError(err)
}

count, _ := rows.RowsAffected()
if count == 0 {
return errors.WithStack(pkg.ErrNotFound)
}
// This confuses people, see https://github.com/ory/hydra/issues/1168
//
// count, _ := rows.RowsAffected()
// if count == 0 {
// return errors.WithStack(pkg.ErrNotFound)
// }

return nil
}

Expand Down

0 comments on commit 4665ebd

Please sign in to comment.