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:
Sam
2018-02-01 15:17:59 +11:00
parent ee0d3f15c1
commit 41986cdb2f
24 changed files with 57 additions and 26 deletions

View File

@@ -2,7 +2,7 @@ require_dependency 'rate_limiter'
class InvitesController < ApplicationController
prepend_before_action :check_xhr, :ensure_logged_in, only: [
requires_login only: [
:destroy, :create, :create_invite_link, :rescind_all_invites,
:resend_invite, :resend_all_invites, :upload_csv
]