-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set axios token for authorization #31
Comments
Hi. Sorry for currently lack of it's documentation. Actually i've just left it until auth module is ready. For setting authentication token, anywhere that you have access to // This will add `Authentication: Bearer ....` header to all requests
$axios.setToken('Token from API or Cookies', 'Bearer') |
Hey thanks for the reply, I don't know what I'm doing wrong but when I do it like this
I get setToken is not a function, knowing that |
Hmm i can't test now but seems it should be attached to prototype instead until bug resolved please use an alternative like this: |
Ok I'll use the alternative solution. |
|
@pio the link leads me to a 404 |
@pi0 Link doesn't work! 404 |
@indiecore-fm @Flyer3d https://auth.nuxtjs.org/api/auth.html |
@kaungmyatlwin can you give example using nuxt/auth module for external API authentication with custom function. detail issue is here |
Hello sorry to make this an issue, I've tried to make this work
Exposes setToken function to $axios so we can easily and globally set authentication tokens.
but without any luck can you please explain how to make it work form a store mutation.
Thanks a lot
The text was updated successfully, but these errors were encountered: