I'm having issues with my rails app when i deploy it to heroku. I'm using steam-omniauth. The log out function works correctly on my machine, but won't work when deployed. Clicking the logout link transfers me to a 404 screen and this error message in the log. looks like its trying to use 'get' for some reason. I've also made sure to rake my db, and pushed the latest versions through to heroku. I'm kind of out of ideas.
at=info method=GET path="/logout" host=warm-sands-60002.herokuapp.com request_id=d01b9d02-238f-41f6-a894-0e74bf64a1c0 fwd="98.169.0.136" dyno=web.1 connect=1ms service=6ms status=404 bytes=1902 protocol=https`
my destroy action in the sessions_controller
def destroy
if current_user
session.delete(:user_id)
flash[:success] = "Goodbye!"
redirect_to root_path
end
end
sessions helper
def current_user
if cookies[:remember_token].present?
@current_user ||= User.find_by_remember_token(cookies[:remember_token])
end
end
routes
match '/auth/:provider/callback', to: 'sessions#create', via: :all
delete '/logout', to: 'sessions#destroy'
and my logout link
<li class="nav-item"><%= link_to 'Log Out', logout_path, method: :delete %></li>
if theres anything i can provide let me know. this is pretty frustrating.
rails_ujs
in your javascript bundle; alternatively, you can set theconfig.sign_out_via
to[:get, :delete]
in devise.rb – Josh Brody