-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update for half done the authenticate not the devise with github
- Loading branch information
Showing
7 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
class ApplicationController < ActionController::Base | ||
protect_from_forgery | ||
def after_sign_in_path_for(resource) | ||
current_user_path | ||
end | ||
#def after_sign_out_path_for(resource) | ||
#root_path | ||
#end | ||
# | ||
def after_sign_out_path_for(resource_or_scope) | ||
request.referrer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class SessionsController < ApplicationController | ||
def create_github | ||
#raise env['omniauth.auth'].to_yaml | ||
user = User.from_omniauth(auth_hash) | ||
session[:user_id] = user.id | ||
redirect_to root_url, notice: "Signed in." | ||
end | ||
|
||
protected | ||
|
||
def auth_hash | ||
request.env['omniauth.auth'] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AddProviderInfoToUser < ActiveRecord::Migration | ||
def change | ||
add_column :users, :provider, :string | ||
add_column :users, :uid, :string | ||
add_column :users, :name, :string | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters