[Fix #1096] Github Oauth

This commit is contained in:
Mathieu Magnin 2017-12-20 15:27:33 +01:00
parent 46b14e97ed
commit 7c0fdbc9f8
7 changed files with 68 additions and 3 deletions

View file

@ -1,5 +1,9 @@
class Administration < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :rememberable, :trackable, :validatable
devise :database_authenticatable, :rememberable, :trackable, :validatable, :omniauthable, omniauth_providers: [:github]
def self.from_omniauth(params)
find_by(email: params["info"]["email"])
end
end