z_auth (zotonic_core v1.0.0-rc.12)
Link to this section Summary
Functions
Set the user to 'confirmed'.
Check if the visitor has been authenticated. Assumes a completely initalized context.
Check if the user is enabled, an user is enabled when the rsc is published and within its publication date range.
Forget about the user being logged on.
Logon an user whose id we know, set all user prefs in the context.
Logon a username/password combination, checks passwords with m_identity.
Logon an user and redirect the user agent. The MQTT websocket MUST be connected.
Allow an admin user to switch to another user account.
Allow an admin user to switch to another user account.
Request the client's auth worker to re-authenticate as a new user
Link to this section Functions
Link to this function
confirm(UserId, Context)
-spec confirm(m_rsc:resource_id(), z:context()) -> {ok, z:context()} | {error, user_not_enabled}.
Link to this function
is_auth(Context)
-spec is_auth(z:context()) -> boolean().
Link to this function
is_enabled(UserId, Context)
-spec is_enabled(m_rsc:resource_id(), z:context()) -> boolean().
Link to this function
logoff(Context)
Link to this function
logon(UserId, Context)
-spec logon(m_rsc:resource_id(), z:context()) -> {ok, z:context()} | {error, user_not_enabled}.
Link to this function
logon_pw(Username, Password, Context)
Link to this function
logon_redirect(UserId, Url, Context)
-spec logon_redirect(m_rsc:resource_id(), binary() | undefined, z:context()) -> ok | {error, term()}.
Link to this function
logon_switch(UserId, Context)
-spec logon_switch(m_rsc:resource_id(), z:context()) -> {ok, z:context()} | {error, eacces}.
Link to this function
logon_switch(UserId, SudoUserId, Context)
-spec logon_switch(m_rsc:resource_id(), m_rsc:resource_id(), z:context()) -> {ok, z:context()} | {error, eacces}.
Link to this function
switch_user(UserId, Context)
-spec switch_user(m_rsc:resource_id(), z:context()) -> ok | {error, eacces}.