# Authentication.authenticateFunction.

authenticate(user_id::Union{String,Symbol,Int}, session) :: Sessions.Session
authenticate(user_id::Union{String,Symbol,Int}, params::Dict{Symbol,Any}) :: Sessions.Session

Stores the user id on the session.

source

# Authentication.deauthenticateFunction.

deauthenticate(session) :: Sessions.Session
deauthenticate(params::Dict{Symbol,Any}) :: Sessions.Session

Removes the user id from the session.

source

# Authentication.is_authenticatedFunction.

is_authenticated(session) :: Bool
is_authenticated(params::Dict{Symbol,Any}) :: Bool

Returns true if a user id is stored on the session.

source

# Authentication.get_authenticationFunction.

get_authentication(session) :: Nullable
get_authentication(params::Dict{Symbol,Any}) :: Nullable

Returns the user id stored on the session, if available.

source

# Authentication.loginFunction.

login(user, session) :: Nullable{Sessions.Session}
login(user, params::Dict{Symbol,Any}) :: Nullable{Sessions.Session}

Persists on session the id of the user object and returns the session.

source

# Authentication.logoutFunction.

logout(session) :: Sessions.Session
logout(params::Dict{Symbol,Any}) :: Sessions.Session

Deletes the id of the user object from the session, effectively logging the user off.

source

# Authentication.current_userFunction.

current_user(session) :: Nullable{User}
current_user(params::Dict{Symbol,Any}) :: Nullable{User}

Returns the User instance corresponding to the currently authenticated user, wrapped into a Nullable.

source

# Authentication.current_user!!Function.

current_user!!(session) :: User
current_user!!(params::Dict{Symbol,Any}) :: User

Attempts to get the User instance corresponding to the currently authenticated user - throws error on failure.

source

# Authentication.with_authenticationFunction.

with_authentication(f::Function, fallback::Function, session)
with_authentication(f::Function, fallback::Function, params::Dict{Symbol,Any})

Invokes f only if a user is currently authenticated on the session, fallback is invoked otherwise.

source

# Authentication.without_authenticationFunction.

without_authentication(f::Function, session)
without_authentication(f::Function, params::Dict{Symbol,Any})

Invokes f if there is no user authenticated on the current session.

source