0

I am trying to provide Sign Up with either an email and password or using Facebook.

I have tried using https://github.com/plataformatec/devise/wiki/OmniAuth%3a-Overview

I followed each of the steps, but I run into the following error in Terminal when I try to run rails server:

'users/omniauth.callbacks' is not a supported controller name

I thought this was referring to the file I was instructed to make (app/controllers/users/omniauth_callback_controllers.rb) but deleting the file does nothing. I have Devise implemented, and I also installed the Omniauth gem. What am I doing incorrectly?

Steps I took:

  1. Added the gem omniauth-facebook to my Gemfile
  2. Ran bundle install in Terminal
  3. Ran rails g migration AddColumnsToUsers provider uid
  4. Ran rake db:migrate
  5. Added the line config.omniauth :facebook, "APP_ID", "APP_SECRET" to the file config/initializers/devise.rb
  6. Added link to Sign Up on sign up page using the line <%= link_to "Sign In With Facebooks", user_omniauth_authorize_path(:facebook %>
  7. Added the line devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks} to the config/routes.rb file
  8. (The part I was confused about) Added a new folder, users, and a new file, omniauth_callbacks_controller.rb (file path is app/controllers/users/omniauth_callbacks_controller.rb) and included code (see Imgur link)
  9. Added code to the app/models/user.rb file (see Imgur link)

https://i.stack.imgur.com/Pa7Rj.jpg

0 Answers0