module Authentic::ActionHelpers(T)
Overview
Helpers methods for Lucky actions
Defined in:
authentic/action_helpers.crInstance Method Summary
-
#current_user : T | Nil
Returns the signed in user if signed in, otherwise returns
nil
-
#current_user? : T | Nil
Return the signed in user if signed in, otherwise returns
nil
- #find_current_user(id : String | T::PrimaryKeyType) : T | Nil
-
#sign_in(authenticatable : T) : Nil
Signs a user in using the browser session.
-
#sign_out : Nil
Sign the user out by clearing the session.
Instance Method Detail
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.
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 ?
).