Devise Authentication Guide with GitHub OmniAuth for Rails Application

Introduction

Setting Devise gem

db/migrate/yyyymmddhhmmss_create_devise_user.rb
rake routes -g devise
t.string :name, null: false, default: ""
db/migrate/yyyymmddhhmmss_create_devise_user.rb
controllers/registrations_controller.rb
config/routes.rb
config/routes

Authorization using Omni-Auth

http://localhost:3000
http://localhost:3000/users/auth/github/callback
config.omniauth :github, 'paste your client ID', 'paste your client secret', scope: 'user:email'
controllers/callbacks_controller.rb
rails g migration AddOmniauthToUsers provider:string uid:string
rake db:migrate
devise :database_authenticatable, :registerable,:recoverable, :rememberable, :trackable, :validatable, :omniauthable
app/models/user.rb
inside binding.pry
app/views/devise/sessions/new.html.erb
rake routes -g auth

Data Engineer at Fortune Magazine. https://www.linkedin.com/in/salma-elshahawy/