Skip to content

Returning custom HTTP error codes from check_auth #8136

@spljs

Description

@spljs

Is your feature request related to a problem? Please describe.
Return an appropriate response code or even a custom one in the checkAuth function

Describe the solution you'd like
Expose the res object to manipulate it , or return a 401 http response code

Additional context

module.exports = {
    checkAuth: async (req) => {
        const token = extractJwt(req);
        req.securityContext = await validateAndParseJwt(token);
        throw new Error("test"); // this causes cube to return http 500
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions