# Logout redirects to Facebook (Rails)

**URL:** <https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503>\
**Category:** Get Help\
**Tags:** rails, tier1, facebook, redirect, logout\
**Created:** [May 5, 2017, 7:18pm UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503 "2017-05-05T19:18:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mail](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mail/32/7145_2.png) [@mail](https://community.auth0.com/u/mail)\
**Post date:** [May 5, 2017, 7:18pm UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503/1 "2017-05-05T19:18:02Z")

</div>

Hi everyone!

I have one identity provider plugged in (Facebook), logout functions established exactly as it is [described](https://auth0.com/docs/quickstart/webapp/rails/03-session-handling) 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](http://facebook.com/home.php) instead of root\_url.

Am I missing something here?

---

<div class="post-metadata">

**Author:** ![paulimar.angulo](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@paulimar.angulo](https://community.auth0.com/u/paulimar.angulo)\
**Post date:** [May 11, 2017, 10:24pm UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503/2 "2017-05-11T22:24:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mail](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mail/32/7145_2.png) [@mail](https://community.auth0.com/u/mail)\
**Post date:** [May 11, 2017, 10:38pm UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503/3 "2017-05-11T22:38:05Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![paulimar.angulo](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@paulimar.angulo](https://community.auth0.com/u/paulimar.angulo)\
**Post date:** [May 19, 2017, 11:31pm UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503/4 "2017-05-19T23:31:00Z")

</div>

Hi @mail. I’m sorry I didn’t reply sooner. I was checking this Doc about logout: [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?

---

<div class="post-metadata">

**Author:** ![mail](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mail/32/7145_2.png) [@mail](https://community.auth0.com/u/mail)\
**Post date:** [May 20, 2017, 1:09am UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503/5 "2017-05-20T01:09:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![paulimar.angulo](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@paulimar.angulo](https://community.auth0.com/u/paulimar.angulo)\
**Post date:** [June 16, 2017, 3:08am UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503/6 "2017-06-16T03:08:32Z")

</div>

Do you still have this issue?

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/logout-redirects-to-facebook-rails/6503/7 "2018-03-02T05:53:43Z")

</div>


