OmniAuth::Kitt
Provides an OAuth connection for Le Wagon alumni.
Usage with Devise
Add this line to your application's Gemfile, then bundle install:
gem 'omniauth-kitt'Go to kitt.lewagon.com/oauth/applications and create a new application.
Callback URL will be http(s)://HOST/users/auth/kitt/callback
Devise.setup do |config|
config.omniauth :kitt, APP_ID, SECRET
# [...]
endYour User model needs this line:
class User < ApplicationRecord
devise :omniauthable, omniauth_providers: [ :kitt ]
# [...]
endAnd your controller:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def kitt
auth = request.env["omniauth.auth"]
# [...]
end
endauth has the following keys:
-
idas an integer -
github_nicknameas a string -
email,first_name,last_name&avatar_urlas strings -
adminas a boolean -
citiesas an array of slugs (City managers)