Skip to content

server side usage with multiple users #107

@house9

Description

@house9

Is it possible to specify a different authorization header per request?

I have a server side api (NestJS) that makes calls to another jsonapi service and I was hoping to use Spraypaint to simplify those requests.

The current implementation seems to assume this is running in a browser and uses static methods to set the authorization header.

Everything works great calling external api except the auth methods are static.

This works but seems very unsafe

Widget.setJWT(token);
const widgets = Widget.per(10).all();
Widget.setJWT("");

Is there another way to handle this scenario with Spraypaint?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions