Uploaded image for project: 'Zapped: AcousticBrainz'
  1. Zapped: AcousticBrainz
  2. AB-318

Return HTTP401 on API endpoints if the user is not logged in

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • Server

      We currently use @login_required on a number of API endpoints. This means that if a client tries to access it while logged out, a redirect is issued to the login page. This makes sense if the user is in a browser, but does not make sense if it's an automated API which expects to receive JSON.

      We should create a new decorator, @api_login_required which returns HTTP 401 and a json message if the request is not authenticated and apply it to all API endpoints that return JSON.

            Unassigned Unassigned
            alastairp Alastair Porter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package