Oh - we do use a 401, but with a Location header
This commit is contained in:
@@ -133,8 +133,10 @@ module Api
|
|||||||
|
|
||||||
session[:return_to_after_authenticating] = original_url
|
session[:return_to_after_authenticating] = original_url
|
||||||
|
|
||||||
# Return 302 redirect to login page
|
# Return 401 Unauthorized with Location header
|
||||||
redirect_to "#{base_url}/signin", allow_other_host: true
|
# Caddy will automatically redirect to this URL
|
||||||
|
response.headers["Location"] = "#{base_url}/signin"
|
||||||
|
head :unauthorized
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_forbidden(reason = nil)
|
def render_forbidden(reason = nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user