mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Refactor requires login logic, reduce duplicate code
This also corrects the positioning in the chain of the check and removes misuse of prepend_before_action
This commit is contained in:
parent
ee0d3f15c1
commit
41986cdb2f
24 changed files with 57 additions and 26 deletions
|
@ -2,7 +2,8 @@ require "mini_mime"
|
|||
require_dependency 'upload_creator'
|
||||
|
||||
class UploadsController < ApplicationController
|
||||
prepend_before_action :check_xhr, :ensure_logged_in, except: [:show]
|
||||
requires_login except: [:show]
|
||||
|
||||
skip_before_action :preload_json, :check_xhr, :redirect_to_login_if_required, only: [:show]
|
||||
|
||||
def create
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue