Skip to content

Instantly share code, notes, and snippets.

@thameera
thameera / action.js
Last active February 3, 2024 00:42
Actions redirect example
/**
* Handler that will be called during the execution of a PostLogin flow.
*
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
exports.onExecutePostLogin = async (event, api) => {
// Craft a signed session token
const token = api.redirect.encodeToken({
secret: 'keyboardcat', // IMPORTANT: Read this from event.secrets