Skip to content

Fix oauth check to verify user exists

Steve Abrams requested to merge 212526-oauth-orphan-check into master

What does this MR do?

The Gitlab::Auth oauth_access_token_check method checks if the token's user has access, but in the case the user has been deleted, a 500 is thrown. This MR adds a check so if there is no user, the auth fails without throwing a 500.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related #212526 (closed)

Edited by Andrew Kelly

Merge request reports