mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
sessions/new also responds to xml and json now
This commit is contained in:
@@ -4,8 +4,9 @@ class Devise::SessionsController < ApplicationController
|
||||
|
||||
# GET /resource/sign_in
|
||||
def new
|
||||
clean_up_passwords(build_resource)
|
||||
render_with_scope :new
|
||||
resource = build_resource
|
||||
clean_up_passwords(resource)
|
||||
respond_with_navigational(resource, stub_options(resource)){ render_with_scope :new }
|
||||
end
|
||||
|
||||
# POST /resource/sign_in
|
||||
@@ -33,4 +34,12 @@ class Devise::SessionsController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def stub_options(resource)
|
||||
hash = { :only => resource_class.authentication_keys }
|
||||
hash[:methods] = [:password] if resource.respond_to?(:password)
|
||||
hash
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user