Hey guys im trying to set data to the app_metadata.authorization.roles using flows post-login and post-registration.
So far Im assigning the roles created using management.assignRolestoUser, I assumed this method would auto add the role in question to the app_metadata.authorization.roles, but it does not.
Im using this code to set the roles using a post-login. it works for the first time the user logs in, but if I use the management api else where to update user metadata, the app_metadata.authorization.roles resets automatically to an empty array.
app_metadata.authorization.roles=["ROLENAME"] to app_metadata.authorization.roles=[]
Unfortunately, the management.assignRolestoUser method only assigns the Roles to the user and does not automatically assign them to the app_metadata.
To set the app_metadata inside a Post-Login Action, please call the api.user.setUserMetadata(name, value) method. Please note that the API object is not callable in a Post-User Registration Action.