Hi everyone,
I just set my first rule, which is basically the standard Set roles to a user rule.
I only changed the domain to adapt it to my needs.
So here are the steps :
- I create a new user manually, using the dashboard.
- I log in with my application (code below).
- In the auth0 dashboard, the user has the role property in app_metadata.
- But if i inspect the JWT in my app with my browser debugger, i do not have the role property in the payload.
- I log out and log in again, the role is set and ready to use.
So am I doing something wrong ?
I guess the rule is fired during the connection, maybe asynchronously making the first login payload not complete.
The front-end is Angular4, here is the Lock code :
lock = new Auth0Lock(*myClientID*, *myDomain*,
{
auth: {
redirect: true,
redirectUrl: window.location.origin,
responseType: "token",
params: {scope: 'openid roles'}
},
language: 'fr',
theme: {
logo: '../../assets/img/logo_auth0.jpg',
primaryColor: '#be0125'
},
allowSignUp: false,
languageDictionary: {
title: "Veuillez vous identifier"
},
});
Thank you for your help !
jicey