Auth0 Home Blog Docs

Logout redirects to Facebook (Rails)

logout
tier1
facebook
rails
redirect

#1

Hi everyone!

I have one identity provider plugged in (Facebook), logout functions established exactly as it is described in QuickStart and logout link in the views as simple as /logout. And everything seems to work, user logs out from the app using the link, but logout redirects to facebook.com/home.php instead of root_url.

Am I missing something here?


#2

Can you show your logout Controller / Logout helper? and, Did you add the url to the Allowed Logout URLs?


#3

Hi @paulimar.angulo!
I checked that I have app url in the allowed logout urls.
Here’s the code:

class LogoutController < ApplicationController
  include LogoutHelper
  def logout
    reset_session
    redirect_to logout_url.to_s
  end
end

module LogoutHelper
  def logout_url
    creds = { client_id: ENV'AUTH0_CLIENT_ID'],
    client_secret: ENV'AUTH0_CLIENT_SECRET'],
    api_version: 1,
    domain: ENV'AUTH0_DOMAIN'] }
    auth0_client = Auth0Client.new(creds)
    auth0_client.logout_url(root_url)
  end
end

#4

Hi @mail. I’m sorry I didn’t reply sooner. I was checking this Doc about logout: https://auth0.com/docs/logout#facebook-users and it says that for facebook user you have to pass an additional requirement. Do you have this in consideration?


#5

Hey! Clicking the provided in docs link results in “Oops!, something went wrong” Auth0 page.


#6

Do you still have this issue?

Can you please show me how are you triggering the logout for the facebook users?


#7