Skip to content
Newer
Older
100644 45 lines (37 sloc) 1.16 KB
02e8c04 @josevalim Update views generator and now have scoped views.
josevalim authored Feb 17, 2010
1 class Devise::SessionsController < ApplicationController
a5ba2ac @carlosantoniodasilva Use prepend_before_filter in require_no_authentication.
carlosantoniodasilva authored Mar 26, 2010
2 prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
b581f86 @josevalim DRY up controllers.
josevalim authored Jan 13, 2010
3 include Devise::Controllers::InternalHelpers
dede8af @josevalim Do not include Devise internal helpers in application controller.
josevalim authored Oct 27, 2009
4
b21b629 @carlosantoniodasilva Better documentation.
carlosantoniodasilva authored Oct 17, 2009
5 # GET /resource/sign_in
7ce49cb @carlosantoniodasilva Configuring session and password controllers as engine, and getting i…
carlosantoniodasilva authored Oct 7, 2009
6 def new
8a15ac6 @josevalim Stub out other views for Registerable.
josevalim authored Feb 8, 2010
7 unless resource_just_signed_up?
8 Devise::FLASH_MESSAGES.each do |message|
9 set_now_flash_message :alert, message if params.try(:[], message) == "true"
10 end
11 end
12
13 build_resource
14 render_with_scope :new
7ce49cb @carlosantoniodasilva Configuring session and password controllers as engine, and getting i…
carlosantoniodasilva authored Oct 8, 2009
15 end
16
b21b629 @carlosantoniodasilva Better documentation.
carlosantoniodasilva authored Oct 17, 2009
17 # POST /resource/sign_in
7ce49cb @carlosantoniodasilva Configuring session and password controllers as engine, and getting i…
carlosantoniodasilva authored Oct 8, 2009
18 def create
a5b2ee5 @josevalim Improve documentation for after_sign_in_path_for.
josevalim authored Jan 16, 2010
19 if resource = authenticate(resource_name)
6d80418 @carlosantoniodasilva Changing flash messages to new Rails defaults :notice/:alert
carlosantoniodasilva authored Jan 20, 2010
20 set_flash_message :notice, :signed_in
a5b2ee5 @josevalim Improve documentation for after_sign_in_path_for.
josevalim authored Jan 16, 2010
21 sign_in_and_redirect(resource_name, resource, true)
643a2ef @carlosantoniodasilva Updating sessions create to handle authentication, still based on war…
carlosantoniodasilva authored Oct 10, 2009
22 else
3781a0f @josevalim Tidy up token authentication implementation.
josevalim authored Feb 2, 2010
23 set_now_flash_message :alert, (warden.message || :invalid)
732e315 @josevalim More changes in update_with_password.
josevalim authored Feb 8, 2010
24 clean_up_passwords(build_resource)
415bcdc @josevalim Added scoped views support. Just turn it on in your Devise.setup.
josevalim authored Nov 21, 2009
25 render_with_scope :new
643a2ef @carlosantoniodasilva Updating sessions create to handle authentication, still based on war…
carlosantoniodasilva authored Oct 10, 2009
26 end
7ce49cb @carlosantoniodasilva Configuring session and password controllers as engine, and getting i…
carlosantoniodasilva authored Oct 8, 2009
27 end
28
b21b629 @carlosantoniodasilva Better documentation.
carlosantoniodasilva authored Oct 17, 2009
29 # GET /resource/sign_out
7ce49cb @carlosantoniodasilva Configuring session and password controllers as engine, and getting i…
carlosantoniodasilva authored Oct 8, 2009
30 def destroy
6d80418 @carlosantoniodasilva Changing flash messages to new Rails defaults :notice/:alert
carlosantoniodasilva authored Jan 20, 2010
31 set_flash_message :notice, :signed_out if signed_in?(resource_name)
d445b4b @josevalim Create after_sign_in_path_for and after_sign_out_path_for hooks and s…
josevalim authored Nov 19, 2009
32 sign_out_and_redirect(resource_name)
7ce49cb @carlosantoniodasilva Configuring session and password controllers as engine, and getting i…
carlosantoniodasilva authored Oct 8, 2009
33 end
3c5bfc9 @josevalim Kick tests back to life.
josevalim authored Oct 12, 2009
34
54cd2cc @josevalim Use _ instead of .
josevalim authored Feb 8, 2010
35 protected
36
a5ba2ac @carlosantoniodasilva Use prepend_before_filter in require_no_authentication.
carlosantoniodasilva authored Mar 26, 2010
37 def resource_just_signed_up?
38 flash[:"#{resource_name}_signed_up"]
39 end
8a15ac6 @josevalim Stub out other views for Registerable.
josevalim authored Feb 8, 2010
40
a5ba2ac @carlosantoniodasilva Use prepend_before_filter in require_no_authentication.
carlosantoniodasilva authored Mar 26, 2010
41 def clean_up_passwords(object)
42 object.clean_up_passwords if object.respond_to?(:clean_up_passwords)
43 end
7ce49cb @carlosantoniodasilva Configuring session and password controllers as engine, and getting i…
carlosantoniodasilva authored Oct 8, 2009
44 end
Something went wrong with that request. Please try again.