lib/clearance/authorization.rb in clearance-1.17.0 vs lib/clearance/authorization.rb in clearance-2.0.0.beta1
- old
+ new
@@ -1,11 +1,11 @@
module Clearance
module Authorization
extend ActiveSupport::Concern
included do
- private :authorize, :deny_access, :require_login
+ private :deny_access, :require_login
end
# Use as a `before_action` to require a user be signed in to proceed.
# {Authentication#signed_in?} is used to determine if there is a signed in
# user or not.
@@ -21,19 +21,10 @@
unless signed_in?
deny_access(I18n.t("flashes.failure_when_not_signed_in"))
end
end
- # @deprecated use {#require_login}
- def authorize
- warn "[DEPRECATION] Clearance's `authorize` before_action is " +
- "deprecated. Use `require_login` instead. Be sure to update any " +
- "instances of `skip_before_action :authorize` or " +
- "`skip_before_action :authorize` as well"
- require_login
- end
-
# Responds to unauthorized requests in a manner fitting the request format.
# `js`, `json`, and `xml` requests will receive a 401 with no body. All
# other formats will be redirected appropriately and can optionally have the
# flash message set.
#
@@ -61,10 +52,10 @@
# @api private
def redirect_request(flash_message)
store_location
if flash_message
- flash[:notice] = flash_message
+ flash[:alert] = flash_message
end
if signed_in?
redirect_to url_after_denied_access_when_signed_in
else