Class: Aspartame::AspartameSessionsController
Instance Method Summary
collapse
#aspartame_current_user, #aspartame_current_user=, #aspartame_current_user?, #aspartame_redirect_back_or, #aspartame_sign_in, #aspartame_sign_out, #aspartame_signed_in?, #aspartame_signed_in_user, #aspartame_store_location
Instance Method Details
#create ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/aspartame/aspartame_sessions_controller.rb', line 8
def create
aspartame_user = Aspartame::AspartameUser.find_by_email(params[:session][:email])
if aspartame_user && aspartame_user.authenticate(params[:session][:password])
aspartame_sign_in aspartame_user
redirect_to aspartame.root_path
else
flash.now[:error] = 'Invalid email/password combination'
render 'new'
end
end
|
#destroy ⇒ Object
20
21
22
23
|
# File 'app/controllers/aspartame/aspartame_sessions_controller.rb', line 20
def destroy
aspartame_sign_out
redirect_to signin_path
end
|