You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are working on app which uses React, Rails (5.2) with devise-token-auth(0.1.43) for authentication . The app has multiple subdomains and we would like to share same user-token across all subdomains. However the old token is un-identified when user gets into a new sub-domain. And application prompts user to login page when he enters a subdomain.
In rails we configured common session_store for all subdomains. As well updated the Rack middleware to apply those changes.
config.session_store :cookie_store,
:key => '_yourappsession',
:domain => :all
On the browser (chrome) we can able to see cookie_store being shared across main domain and subdomain pages. However user session/token is not shared between them.
Is there a way to share token across subdomains?
The text was updated successfully, but these errors were encountered:
The short answer is that's a react question, not a devise token auth question - you need to figure out how share your tokens between subdomains. NB that this is not possible if you only use local storage on your front end, so you'll have to find some way to store the tokens as cookies that shared by the top level domain and then use those cookies to authenticate against the (single) backend.
We are working on app which uses React, Rails (5.2) with devise-token-auth(0.1.43) for authentication . The app has multiple subdomains and we would like to share same user-token across all subdomains. However the old token is un-identified when user gets into a new sub-domain. And application prompts user to login page when he enters a subdomain.
In rails we configured common session_store for all subdomains. As well updated the Rack middleware to apply those changes.
config.session_store :cookie_store,
:key => '_yourappsession',
:domain => :all
On the browser (chrome) we can able to see cookie_store being shared across main domain and subdomain pages. However user session/token is not shared between them.
Is there a way to share token across subdomains?
The text was updated successfully, but these errors were encountered: