1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

No redirect when Devise API is accessed via JSON

This commit is contained in:
Sebastian Wramba 2013-05-07 10:18:23 +02:00
parent bb5d65209a
commit 43f7cf0f12
4 changed files with 8 additions and 8 deletions

View file

@ -32,12 +32,12 @@ class Devise::ConfirmationsController < DeviseController
# The path used after resending confirmation instructions.
def after_resending_confirmation_instructions_path_for(resource_name)
new_session_path(resource_name)
new_session_path(resource_name) if is_navigational_format?
end
# The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
after_sign_in_path_for(resource)
after_sign_in_path_for(resource) if is_navigational_format?
end
end

View file

@ -42,12 +42,12 @@ class Devise::PasswordsController < DeviseController
protected
def after_resetting_password_path_for(resource)
after_sign_in_path_for(resource)
after_sign_in_path_for(resource) if is_navigational_format?
end
# The path used after sending reset password instructions
def after_sending_reset_password_instructions_path_for(resource_name)
new_session_path(resource_name)
new_session_path(resource_name) if is_navigational_format?
end
# Check if a reset_password_token is provided in the request

View file

@ -96,7 +96,7 @@ class Devise::RegistrationsController < DeviseController
# The path used after sign up. You need to overwrite this method
# in your own RegistrationsController.
def after_sign_up_path_for(resource)
after_sign_in_path_for(resource)
after_sign_in_path_for(resource) if is_navigational_format?
end
# The path used after sign up for inactive accounts. You need to overwrite
@ -108,7 +108,7 @@ class Devise::RegistrationsController < DeviseController
# The default url to be used after updating a resource. You need to overwrite
# this method in your own RegistrationsController.
def after_update_path_for(resource)
signed_in_root_path(resource)
signed_in_root_path(resource) if is_navigational_format?
end
# Authenticates the current scope and gets the current resource from the session.

View file

@ -33,12 +33,12 @@ class Devise::UnlocksController < DeviseController
# The path used after sending unlock password instructions
def after_sending_unlock_instructions_path_for(resource)
new_session_path(resource)
new_session_path(resource) if is_navigational_format?
end
# The path used after unlocking the resource
def after_unlock_path_for(resource)
new_session_path(resource)
new_session_path(resource) if is_navigational_format?
end
end