Skip to content

Instantly share code, notes, and snippets.

@stevesohcot
Created January 30, 2016 19:34
Show Gist options
  • Save stevesohcot/59208eb1d0d5886d8afc to your computer and use it in GitHub Desktop.
Save stevesohcot/59208eb1d0d5886d8afc to your computer and use it in GitHub Desktop.
OmniAuth Identities Controller
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