Convos::Plugin::Auth - Convos plugin for handling authentication
DESCRIPTION
Convos::Plugin::Auth is used to register, login and logout a user. This plugin is always loaded by Convos, but you can override the "HELPERS" with a custom auth plugin if you like.
Note that this plugin is currently EXPERIMENTAL. Let us know if you are/have created a custom plugin.
HELPERS
auth.login_p
$user = await $c->auth->login_p(\%credentials);
Used to login a user. %credentials
normally contains an email
and password
.
auth.logout
$p = $c->auth->logout_p({});
Used to log out a user.
auth.register
$user = await $c->auth->register(\%credentials);
Used to register a user. %credentials
normally contains an email
and password
.
user.connection_create_p
$connection = await $c->user->connection_create_p($user, $connection_url);
Used to create a new connection for a Convos::Core::User.
user.has_admin_rights
$user = await $c->user->has_admin_rights($user);
Sets up a Convos::Core::User object right after registering the first time.
user.initial_setup_p
$user = await $c->user->initial_setup_p($user);
Sets up a Convos::Core::User object right after registering the first time.
user.load_p
$user = await $c->user->load_p($email);
$user = await $c->user->load_p;
Used to return a Convos::User object representing the logged in user or a user with email $email
.
METHODS
register
$auth->register($app, \%config);