module

Authentic::ActionHelpers(T)

Helpers methods for Lucky actions

Instance methods

current_user

Returns the signed in user if signed in, otherwise returns nil

This method is often overridden by different modules/pipes. For example, When sign in is required this method is typically overridden by calling not_nil! since the user will always be returned.

For an example, see the Auth::RequireSignIn module in a newly generated Lucky project.

Source
current_user?

Return the signed in user if signed in, otherwise returns nil

This method should not be overridden. If you want to require a current user, override the current_user method (note no ?).

Source
find_current_user(id : String | T::PrimaryKeyType) : T | Nil
Source
sign_in(authenticatable : T) : Nil

Signs a user in using the browser session.

Source
sign_out

Sign the user out by clearing the session.

Source