Created
January 30, 2016 19:34
-
-
Save stevesohcot/59208eb1d0d5886d8afc to your computer and use it in GitHub Desktop.
OmniAuth Identities Controller
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 IdentitiesController < ApplicationController | |
skip_before_action :require_authentication, only: [:new] | |
def new | |
# When the app first opens, they're brought to the sign-up page | |
# If they have a cookie set, try to log in with it | |
if logged_out? | |
check_if_remembered | |
end | |
if logged_in? | |
redirect_to root_path | |
return | |
end | |
params[:password_confirmation] = params[:password] | |
@identity = request.env['omniauth.identity'] || Identity.new | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment