abstract class BrowserAction

Included Modules

Direct Known Subclasses

Defined in:

actions/browser_action.cr

Constant Summary

AFTER_PIPES = [set_previous_page_url] of Symbol
BEFORE_PIPES = [verify_accepted_format, protect_from_forgery, disable_caching, require_logged_in, require_logged_out, pin_login_to_ip_address, enforce_login_idle_timeout, check_authorization, set_frame_guard_header, set_sniff_guard_header, set_xss_guard_header] of Symbol
EXPOSURES = [] of Symbol
PARAM_DECLARATIONS = [] of Crystal::Macros::TypeDeclaration
ROUTE_SETTINGS = {prefix: ""}
SKIPPED_PIPES = [pin_login_to_ip_address] of Symbol

Class Method Summary

Instance Method Summary

Class Method Detail

def self._accepted_formats #

[View source]

Instance Method Detail

def authorize?(user : User) : Bool #

[View source]
def authorize?(user : Shield::User) : Bool #

[View source]
def check_authorization #

[View source]
def current_login #

[View source]
def current_login? : Login | Nil #

def current_user #

[View source]
def current_user? : User | Nil #

def disable_caching #

[View source]
def do_check_authorization_failed #

[View source]
def do_enforce_login_idle_timeout_failed #

[View source]
def do_pin_email_confirmation_to_ip_address_failed #

[View source]
def do_pin_login_to_ip_address_failed #

[View source]
def do_pin_password_reset_to_ip_address_failed #

[View source]
def do_require_logged_in_failed #

[View source]
def do_require_logged_out_failed #

[View source]
def enforce_login_idle_timeout #

[View source]
def frame_guard_value : String #

[View source]
def logged_in? : Bool #

[View source]
def logged_out? : Bool #

[View source]
def pin_email_confirmation_to_ip_address #

[View source]
def pin_login_to_ip_address #

[View source]
def pin_password_reset_to_ip_address #

[View source]
def previous_page_url #

def previous_page_url? : String | Nil #

def redirect_back(*, fallback : Lucky::Action.class, status : HTTP::Status, allow_external = false) #

def redirect_back(*, fallback : Lucky::RouteHelper, status : HTTP::Status, allow_external = false) #

def redirect_back(*, fallback : String, status : Int32 = 302, allow_external : Bool = false) #
Description copied from module Lucky::Redirectable

Redirects the browser to the page that issued the request (the referrer) if possible, otherwise redirects to the provided default fallback location.

The referrer information is pulled from the 'Referer' header on the request. This is an optional header, and if the request is missing this header the fallback will be used.

redirect_back fallback: "/users"

A redirect status can be specified

redirect_back fallback: "/home", status: 301

External referers are ignored by default. It is determined by comparing the referer header to the request host. They can be explicitly allowed if necessary

redirect_back fallback: "/home", allow_external: true


def remote_ip : Socket::IPAddress #

def remote_ip? : Socket::IPAddress | Nil #

def require_logged_in #

[View source]
def require_logged_out #

[View source]
def return_url #

def return_url? : String | Nil #

def set_no_referrer_policy #

[View source]
def set_previous_page_url #