Skip to content

Commit

Permalink
Fixed to prevent redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
robzolkos committed Nov 21, 2011
1 parent 14cf17e commit 256c722
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/user_sessions_controller.rb
Expand Up @@ -5,12 +5,12 @@ class UserSessionsController < ApplicationController

# omniauth callback method
def create
omniauth = request.env['omniauth.auth']
omniauth = env['omniauth.auth']

user = User.find_by_uid(omniauth['uid'])
if not user
# New user registration
user = User.create!(:uid => omniauth['uid'],
user = User.create!(:uid => omniauth['uid'],
:first_name => omniauth['extra']['first_name'],
:last_name => omniauth['extra']['last_name'])
end
Expand All @@ -25,7 +25,7 @@ def create
# Omniauth failure callback
def failure
flash[:notice] = params[:message]
redirect_to root_path

end

# logout - Clear our rack session BUT essentially redirect to the provider
Expand Down
6 changes: 6 additions & 0 deletions app/views/user_sessions/failure.html.erb
@@ -0,0 +1,6 @@
<h1>Fail</h1>

<%= notice %>

<br/>
<a href="/auth/joshid">Retry Login</a>

0 comments on commit 256c722

Please sign in to comment.