devise icon indicating copy to clipboard operation
devise copied to clipboard

Is it possible to integrate Devise with a chrome-extension session management through a rails app?

Open benlieb opened this issue 2 years ago • 0 comments

I have made a React-based Chrome extension for language learners. I would like to add features that will require a backend server and unique user sessions which I am creating.

The server will be a ruby on rails application and I usually use Devise for this. Normal session management with rails apps involves the browser sending back the session cookie when requests are made to the cookie domain.

However, my client "app" is now an extension that is not accessing my site directly. I'm unsure of the specifics of how to maintain sessions that correspond to the backend server through the extension.

This is what I think so far:

  • Client signs in via a form on the extension
  • The backend responds with a session key of some kind
  • The extension saves the key in localstorage or maybe a cookie?
  • On subsequent page loads, the extension load script re-validates the session cookie in some way by sending it back to the server?
  • I usually use Devise for log-in on the back-end server, but I'm not sure how to integrate the flow I need since it differs from standard client-server session interactions. Or does it?

Any chance you could help point me in the right direction for how this might work?

benlieb avatar Nov 24 '21 21:11 benlieb