Last active
February 18, 2025 20:27
-
-
Save stefanomarra/e8fd4dd434bca8d46296c763317b32b9 to your computer and use it in GitHub Desktop.
This Auth0 Action script adds the user_metadata field to both the ID Token and Access Token after user login to support user metadata in Teachfloor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.onExecutePostLogin = async (event, api) => { | |
const namespace = "https://app.teachfloor.com/"; | |
const userMetadata = event.user.user_metadata || {}; | |
api.idToken.setCustomClaim(`${namespace}user_metadata`, userMetadata); | |
api.accessToken.setCustomClaim(`${namespace}user_metadata`, userMetadata); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment