module Utils::CurrentUser

Overview

Helper to grab user and authority from a request

Direct including types

Defined in:

controllers/utilities/current-user.cr

Constant Summary

Log = ::App::Log.for("authorize!")

Instance Method Summary

Instance Method Detail

def authorize! #

Parses, and validates JWT if present. Throws Error::MissingBearer and JWT::Error.


[View source]
def check_admin #

Read admin status from supplied request JWT


[View source]
def check_support #

Read support status from supplied request JWT


[View source]
def is_admin? #

[View source]
def is_support? #

[View source]
def user_token : UserJWT #

Getter for user_token


[View source]