lib/authpwn_rails/session.rb in authpwn_rails-0.6.0 vs lib/authpwn_rails/session.rb in authpwn_rails-0.7.0
- old
+ new
@@ -86,13 +86,23 @@
# GET /session
def show
@user = current_user || User.new
if @user.new_record?
welcome
- render :action => :welcome unless performed?
+ unless performed?
+ respond_to do |format|
+ format.html { render :action => :welcome }
+ format.json { render :json => {} }
+ end
+ end
else
home
- render :action => :home unless performed?
+ unless performed?
+ respond_to do |format|
+ format.html { render :action => :home }
+ format.json { render :json => @user }
+ end
+ end
end
end
# POST /session
def create