Skip to content

Catch JWT errors and return them gracefully #147

@zwolf

Description

@zwolf

A user makes a request to the API and includes their Authorization header. The token contained therein was encoded with the Panoptes staging key, and the first attempt to verify it (via the :authenticated_admin? method in the PanoptesApi service) causes the jwt gem to raise a JWT::VerificationError.

Currently this causes a 500 and a report to Sentry. This error, or maybe a more comprehensive group of potential JWT:: errors, should be caught and serialized back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Maintenance

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions