Module: EasyAuth::Controllers::Sessions
Instance Method Summary
collapse
append_features, extended, reverse_included
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
74
75
76
77
78
79
|
# File 'lib/easy_auth/controllers/sessions.rb', line 74
def method_missing(method_name, *args)
unless method_name.to_s =~ /after_\w+_with_\w+/
super
end
end
|
Instance Method Details
#create ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/easy_auth/controllers/sessions.rb', line 8
def create
if identity = EasyAuth.authenticate(self)
identity.set_account_session(session)
set_remember(identity)
if identity.remember
cookies[:remember_token] = { :value => identity.generate_remember_token!, :expires => identity.remember_time.from_now }
end
after_successful_sign_in(identity)
else
@identity = EasyAuth.find_identity_model(params).new(params[params[:identity]])
after_failed_sign_in(@identity)
end
end
|
#destroy ⇒ Object
22
23
24
25
26
27
|
# File 'lib/easy_auth/controllers/sessions.rb', line 22
def destroy
session.delete(:session_token)
session.delete(:account_class)
cookies.delete(:remember_token)
after_sign_out
end
|
#new ⇒ Object
4
5
6
|
# File 'lib/easy_auth/controllers/sessions.rb', line 4
def new
EasyAuth.new_session(self)
end
|