Skip to content

Instantly share code, notes, and snippets.

@donchan922
Created December 16, 2018 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/5a2b638b8162942cef3693f5dcffee6b to your computer and use it in GitHub Desktop.
Save donchan922/5a2b638b8162942cef3693f5dcffee6b to your computer and use it in GitHub Desktop.
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