Skip to content
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

Retrieve headers token #21

Open
llaine opened this issue Feb 23, 2016 · 4 comments
Open

Retrieve headers token #21

llaine opened this issue Feb 23, 2016 · 4 comments

Comments

@llaine
Copy link

llaine commented Feb 23, 2016

I'm working with the window fetch polyfill library and I'm trying retrieve data from the secure API.
How can I get the tokens that are use for every request in J-Toker and use them with the fetch lib.

Is there any kind of function to do something like that ?

import Auth from './auth-configuration';
// Getting the tokens
const tokens = Auth.getTokens();
// And use them is the request
fetch('/secure-api', tokens).then(...)
@llaine llaine changed the title Retrieve headers tokens Retrieve headers token Feb 23, 2016
@llaine
Copy link
Author

llaine commented Mar 1, 2016

anyone ?

@jrforrest
Copy link

Looks like $.auth.retrieveData('authHeaders') will retrieve the headers.

@danielmockaitis
Copy link

If you specify that as your headers, it will log you out. How do I put the headers in and still be able to keep my user logged in?

@jrforrest
Copy link

jrforrest commented Feb 8, 2018

@dannymockaitis There's not a lot of detail in your problem description, but it sounds like the headers aren't getting into your request properly, causing a 401 to come back and log you out. Check out the headers in the request you're extracting the tokens for and compare them to the headers j-toker's using in its requests to verify correctness.

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

No branches or pull requests

3 participants