Openmaize v0.11.0 Openmaize.Report

This module provides error and info messages and handles redirects if the option redirects is set to true.

If you are using Phoenix, then the error and info messages will be sent to phoenix_flash to be shown in the web browser.

Summary

Functions

Handle authentication errors

Handle authorization errors

Redirect the connection to the home page with an info message

Redirect the connection to the user’s role’s page with an info message

Functions

handle_error(conn, message, bool)

Handle authentication errors.

These errors relate to there being no current user for a protected page.

If redirects is set to true, the user will be redirected to the login page. If redirects is false, a json-encoded message will be sent to the user.

handle_error(conn, role, message, bool)

Handle authorization errors.

These errors relate to the current user not being permitted to access the requested page.

If redirects is set to true, the user will be redirected to the login page. If redirects is false, a json-encoded message will be sent to the user.

handle_info(conn, message)

Redirect the connection to the home page with an info message.

handle_info(conn, role, message)

Redirect the connection to the user’s role’s page with an info message.