Skip to content

Commit

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

Signed-off-by: arekkas <aeneas@ory.am>
  • Loading branch information
arekkas committed Nov 16, 2018
1 parent 196a85f commit feba8dc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions consent/manager_sql.go
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 feba8dc

Please sign in to comment.