Skip to main content

Action

The following Post Login action checks the user’s roles from event.authorization and sets them as a custom claim on the ID token, denying access when no roles are present.
test-an-action.js

Unit Test

The unit tests mock the event and api objects to verify that admin users get the custom claim set, while users with no roles or a missing authorization object are denied access.
test-an-action.spec.js
package.json
test-an-action.spec.js
package.json
.mocharc.json
test-an-action.spec.js
package.json