Added Github authentication option, disabled by default with enable options in settings.

This commit is contained in:
nverba
2013-02-26 04:28:32 +00:00
committed by nverba
parent b50e0536c7
commit b45f872c04
18 changed files with 170 additions and 1 deletions

View File

@@ -177,6 +177,10 @@ class UsersController < ApplicationController
if auth[:facebook].present? and FacebookUserInfo.find_by_facebook_user_id(auth[:facebook][:facebook_user_id]).nil?
FacebookUserInfo.create!(auth[:facebook].merge(user_id: user.id))
end
if auth[:github_user_id] && auth[:github_screen_name] && GithubUserInfo.find_by_github_user_id(auth[:github_user_id]).nil?
GithubUserInfo.create(:user_id => user.id, :screen_name => auth[:github_screen_name], :github_user_id => auth[:github_user_id])
end
end