Fix API authentication returns 400 when providing the wrong credentials

Closes #959 (closed)

Previous behaviour

Steps to reproduce:

  1. Authenticate at /api/v1/token-auth
  2. Get a 400

New behaviour

Steps to validate that it works:

  1. Authenticate at /api/v1/token-auth
  2. Get a 401

Merge request reports

Loading