-
Notifications
You must be signed in to change notification settings - Fork 46
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
Updating localStorage Auth Token #20
Comments
Hi, have you managed to get the token saved somehow? Neither cookies nor localStorage works for me. Update 1: I found out why it's not working for me, because it doesn't read the custom header values. Unfortunately, I have yet to find a solution. Update 2: Adding the expose option to a resource in rack-cors solves this issue. config.middleware.insert_before 0, 'Rack::Cors' do
allow do
origins '*'
resource '*', headers: :any, expose: ['access-token', 'token-type', 'client', 'expiry', 'uid'], methods: [:get, :post, :options, :patch]
end
end |
Look at the casing of the response headers... this has tripped me up in all sorts of scenarios that depend on auth headers, not just using this lib. I dont know why, but some appservers upcase each word =( |
@vassyz was having same problem and what you said fixed it. thanks! |
I was having the same issue, in 2023! Adding |
Didn't think anyone was still using this in 2023. Can't even remember what I was doing with it back then. |
It's hard to find something that does token auth with a Rails 7 backend these days. All the new frameworks want to sell you on their serverless JS-only toys. But I'm open to suggestions 😃 I've only been at this new project for a few days... |
I can't seem to get the Auth Token saved in localStorage to refresh.
From what I understand each request to the API should send back a new token,
but the token in jToker doesn't update. Could someone point me in the right direction?
The text was updated successfully, but these errors were encountered: