I’m trying to update the user profile, email, password, and metadata.
The idea is to give the user the option to change in our app their profile data, such email, password and some user metadata.
Update the metadata, is OK. But, email and password are impossible. Tried a thousand of ways.
-
I get the Access Token
const accessToken = await getAccessTokenSilently({ audience, scope: "profile user_metadata update:current_user update:current_user_metadata update:current_user_identities", });
-
Send the Patch
if (isAuthenticated) {
const users = ${audience}users
;
const userId = user.sub;
Axios.patch(
`${users}/${userId}`,
{
user_metadata: {
first_name: "First",
last_name: "Last",
},
email: "test@test.com",
password: "teste"
},
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
).then((response) => {
console.log("RESPONSE", response);
});
}
- No way, I tried different of scopes. All I got is:
{"statusCode":403,"error":"Forbidden","message":"You cannot update the following fields: password","errorCode":"insufficient_scope"}
-
Our login page has the following scopes:
<Auth0Provider
domain={config.domain}
clientId={config.clientId}
audience={config.audience}
redirectUri={${window.location.origin}/cvm
}
onRedirectCallback={onRedirectCallback}
scope=“profile user_metadata update:current_user update:current_user_metadata update:current_user_identities”
useRefreshTokens={true}
>
I need help, please. It shouldn’t be too difficult.