Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 25 lines (21 sloc) 0.607 kb
f45fdd1 @binarylogic Initial commit
authored
1 class UserSessionsController < ApplicationController
2 before_filter :require_no_user, :only => [:new, :create]
3 before_filter :require_user, :only => :destroy
4
5 def new
6 @user_session = UserSession.new
7 end
8
9 def create
10 @user_session = UserSession.new(params[:user_session])
d1cf131 @binarylogic Removed all password resets and openid code and put them in their own…
authored
11 if @user_session.save
12 flash[:notice] = "Login successful!"
13 redirect_back_or_default account_url
14 else
15 render :action => :new
f45fdd1 @binarylogic Initial commit
authored
16 end
17 end
18
19 def destroy
63cac21 @binarylogic Updated code with authlogic
authored
20 current_user_session.destroy
f45fdd1 @binarylogic Initial commit
authored
21 flash[:notice] = "Logout successful!"
22 redirect_back_or_default new_user_session_url
23 end
24 end
Something went wrong with that request. Please try again.