Created
December 16, 2018 01:25
-
-
Save donchan922/5a2b638b8162942cef3693f5dcffee6b to your computer and use it in GitHub Desktop.
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
class SessionsController < ApplicationController | |
def create | |
# request.env['omniauth.auth']にユーザのTwitter認証情報が格納されている | |
user_data = request.env['omniauth.auth'] | |
session[:nickname] = user_data[:info][:nickname] | |
redirect_to root_path, notice: 'ログインしました' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment