The tulip.pkg.flash
module exports the flash
package.
Registering this package provides the following method and field extensions.
ok, err = Request:flash(...)
Adds flash messages to be stored for the next request. Flash messages are (short) feedback messages that are generated in one request, but only used in a subsequent request (e.g. following an account creation, after a redirect to the login page, the "account created, please login" message could be displayed). To that end, the flash messages are stored in a session cookie by the middleware registered with this package.
Args:
Returns:
The following middleware are registered and can be referenced by name in the configuration.
Must be added before any handler that writes the response and any handler that uses existing flash messages. Available flash messages for a request (that is, flash messages that were added in a previous request) are stored on req.locals.flash. Messages added by Request:flash will be stored in a cookie before the response is written.
commit 3ebfbd288b8e5c95fdf8ce2027a0e94cfa1c8976 Author: Martin Angers <martin.n.angers@gmail.com> Date: 2021-02-25T14:07:12-05:00 Update to reflect Request:validate_body