# No route matches \[POST\] "/auth/auth0"

**URL:** <https://community.auth0.com/t/no-route-matches-post-auth-auth0/87485>\
**Category:** Get Help\
**Tags:** rails, auth0\
**Created:** [July 22, 2022, 1:46pm UTC](https://community.auth0.com/t/no-route-matches-post-auth-auth0/87485 "2022-07-22T13:46:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazuki.saito](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kazuki.saito/32/33596_2.png) [@kazuki.saito](https://community.auth0.com/u/kazuki.saito)\
**Post date:** [July 22, 2022, 1:46pm UTC](https://community.auth0.com/t/no-route-matches-post-auth-auth0/87485/1 "2022-07-22T13:46:33Z")

</div>

I’m following the tutorial below, but I get an error.

- [Auth0 Ruby On Rails SDK Quickstarts: Login](https://auth0.com/docs/quickstart/webapp/rails/01-login)
- [File: README — Documentation for omniauth-auth0 (1.4.2)](https://www.rubydoc.info/gems/omniauth-auth0/1.4.2)

error:  
No route matches [POST] “/auth/auth0”

version:

```auto
$ gem list | grep omniauth
omniauth (1.9.1)
omniauth-auth0 (1.4.2)
omniauth-oauth2 (1.3.1)
omniauth-rails_csrf_protection (0.1.2)

$ ruby -v
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-darwin21]

$ rails -v
Rails 4.2.11.3

```

```auto
<-- app/views/xxx/xxx.haml -->
= link_to 'Login', '/auth/auth0', method: :post

```

```auto
<-- config/initializers/auth0.rb -->

require 'omniauth'
require 'omniauth-auth0'

AUTH0_CONFIG = Rails.application.config_for(:auth0)

Rails.application.config.middleware.use OmniAuth::Builder do
  provider(
    :auth0,
    AUTH0_CONFIG['auth0_client_id'],
    AUTH0_CONFIG['auth0_client_secret'],
    AUTH0_CONFIG['auth0_domain'],
    callback_path: '/auth/auth0/callback',
    authorize_params: {
      scope: 'openid profile'
    }
  )
end

```

```auto
<-- config/routes.rb -->
  get '/auth/auth0/callback' => 'auth0#callback'
  get '/auth/failure' => 'auth0#failure'
  get '/auth/logout' => 'auth0#logout'

```

Please help!

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [July 22, 2022, 3:44pm UTC](https://community.auth0.com/t/no-route-matches-post-auth-auth0/87485/3 "2022-07-22T15:44:59Z")

</div>

Hi @kazuki.saito,

Welcome to the Auth0 Community!

I understand that you have encountered issues with logging in to your Application.

After testing this myself, I was able to successfully download the Ruby on Rails Quickstart, run the application, and log in.

When looking closely at your code snippet, I noticed that you are calling the `link_to` for login. Instead, have you tried using `button_to` to see if that works?

The `button_to` is what I am using in the [Auth0 Ruby on Rails Quickstart](https://auth0.com/docs/quickstart/webapp/rails/01-login).

I am looking forward to your reply.

Thank you.

---

<div class="post-metadata">

**Author:** ![kazuki.saito](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kazuki.saito/32/33596_2.png) [@kazuki.saito](https://community.auth0.com/u/kazuki.saito)\
**Post date:** [July 25, 2022, 3:00am UTC](https://community.auth0.com/t/no-route-matches-post-auth-auth0/87485/4 "2022-07-25T03:00:58Z")

</div>

Hi @rueben.tiow ,  
Thank you for your reply!

I tried it with `button_to`, but it didn’t change.

```auto
<-- app/views/xxx/xxx.haml -->
= button_to 'Login', '/auth/auth0', method: :post

```

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [July 27, 2022, 5:33pm UTC](https://community.auth0.com/t/no-route-matches-post-auth-auth0/87485/5 "2022-07-27T17:33:51Z")

</div>

Hi @kazuki.saito,

Thank you for your update.

I have one other suggestion for you to try. Could you please try updating your omniauth libraries to the latest version?

Once you have updated the libraries, could you please retry logging in and see if you can log in successfully?

Thanks.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 22, 2022, 9:34am UTC](https://community.auth0.com/t/no-route-matches-post-auth-auth0/87485/6 "2022-12-22T09:34:14Z")

</div>


