Created
July 5, 2021 10:28
-
-
Save juque/b715fb3b1c1b7f9598f00ea3f3efbe71 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 SessionController < ApplicationController | |
def create | |
session[:access_token] = request.env['omniauth.auth']['credentials']['token'] | |
session[:user_name] = request.env['omniauth.auth']['info']['name'] | |
flash[:notice] = "Welcome!" | |
redirect_to dashboard_index_url | |
end | |
def destroy | |
session.delete :access_token | |
session.delete :user_name | |
redirect_to root_url | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment