0

This is my first question on StackOverflow! I've searched around and can't seem to find anyone else having this problem, so here goes.

I'm using Ruby on Rails and Devise + OmniAuth to allow people to sign in through Facebook & Google on my site. This works great -- users can sign in and sign out perfectly, so all the routes seem to be working fine.

HOWEVER, occasionally signing out will not work -- it will bring me to a blank page, and upon returning to the website, I'll still be logged in, and there's no way to sign out. If I try opening the site in incognito, or clear my history, it all works again.

I'm guessing the culprit is in the cookies -- it keeps my info so it keeps me logged in even though I want to sign out. I'm a newb at programming though so I'm not sure where to go to fix this.

Thanks for any help!

1 Answers1

0

Turns out it had nothing to do with cookies -- Devise uses https, so if I returned to the page with just http and tried signing out, it would try to do a GET request for the https even though there was none (otherwise it just issues the default DELETE request as normal).

I figured out the answer through this stack overflow question: Devise No route matches [GET] "/users/sign_out" from link with delete specified

I used the first answer by Chris Chattan but there's other ones that might suit you too (you can just use https for everything if you want)

Community
  • 1
  • 1