As rule is deprecating in near future, I want to convert this rule to action:
function (user, context, callback) {
user.awsRole = 'arn:aws:iam::1234567890:role/Auth0v2,arn:aws:iam::1234567890:saml-provider/Auth0';
user.awsRoleSession = user.name;
context.samlConfiguration.mappings = {
'https://aws.amazon.com/SAML/Attributes/Role': 'awsRole',
'https://aws.amazon.com/SAML/Attributes/RoleSessionName': 'awsRoleSession'
};
callback(null, user, context);
}
I tried to convert it as following for action:
exports.onExecutePostLogin = async (event, api) => {
const user = event.user;
user.awsRole = 'arn:aws:iam::1234567890:role/Auth0v2,arn:aws:iam::1234567890:saml-provider/Auth0';
};
However it shows the warning:
Property 'awsRole' does not exist on type 'User & { multifactor?: string[] | undefined; } & { identities: UserIdentity[]; }'.(2339)