mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: don't return 200s when login is required to paths
When running `ensure_login_required` it should always happen prior to `check_xhr` cause check xhr will trigger a 200 response
This commit is contained in:
@ -8,10 +8,18 @@ require_dependency 'admin_confirmation'
|
||||
class UsersController < ApplicationController
|
||||
|
||||
skip_before_action :authorize_mini_profiler, only: [:avatar]
|
||||
skip_before_action :check_xhr, only: [:show, :badges, :password_reset, :update, :account_created, :activate_account, :perform_account_activation, :user_preferences_redirect, :avatar, :my_redirect, :toggle_anon, :admin_login, :confirm_admin]
|
||||
|
||||
before_action :ensure_logged_in, only: [:username, :update, :user_preferences_redirect, :upload_user_image,
|
||||
:pick_avatar, :destroy_user_image, :destroy, :check_emails, :topic_tracking_state]
|
||||
prepend_before_action :check_xhr, :ensure_logged_in, only: [
|
||||
:username, :update, :user_preferences_redirect, :upload_user_image,
|
||||
:pick_avatar, :destroy_user_image, :destroy, :check_emails, :topic_tracking_state,
|
||||
:preferences
|
||||
]
|
||||
|
||||
skip_before_action :check_xhr, only: [
|
||||
:show, :badges, :password_reset, :update, :account_created,
|
||||
:activate_account, :perform_account_activation, :user_preferences_redirect, :avatar,
|
||||
:my_redirect, :toggle_anon, :admin_login, :confirm_admin
|
||||
]
|
||||
|
||||
before_action :respond_to_suspicious_request, only: [:create]
|
||||
|
||||
|
Reference in New Issue
Block a user