Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Use axios interceptors to send JWT token #3

Open
Stefano1990 opened this issue Jun 15, 2019 · 1 comment
Open

Use axios interceptors to send JWT token #3

Stefano1990 opened this issue Jun 15, 2019 · 1 comment

Comments

@Stefano1990
Copy link

Wouldn't it make sense to check if there is a jwt token (or some other type of authorisation token) in the cookie or session in the axios.js boot file to send this with every request?

Otherwise every additional store has to manually set the JWT token header on axios before every api request.

@stefanvanherwijnen
Copy link
Owner

There is a single store that handles all authentication logic. The login function for example sets the authorization header)(

export function login (state, data) {
).

I think this is what you mean, except it isn't handled in the axios.js boot file?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants