Class: Puffer::Sessions::Simple
- Inherits:
-
Base
- Object
- ApplicationController
- Base
- Puffer::Sessions::Simple
show all
- Defined in:
- lib/puffer/backends/controllers/sessions/simple.rb
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/puffer/backends/controllers/sessions/simple.rb', line 11
def create
@record = resource.adapter.find_first(:conditions => {:email => resource.attributes[:email]})
if @record && @record.authenticate(resource.attributes[:password])
session[:puffer_user_id] = @record.id
redirect_back_or admin_root_url
else
@record = resource.new_member :email => resource.attributes[:email]
render 'new'
end
end
|
#destroy ⇒ Object
23
24
25
26
|
# File 'lib/puffer/backends/controllers/sessions/simple.rb', line 23
def destroy
session.delete(:puffer_user_id)
redirect_to new_admin_session_url
end
|
#new ⇒ Object
7
8
9
|
# File 'lib/puffer/backends/controllers/sessions/simple.rb', line 7
def new
@record = resource.new_member
end
|