简体   繁体   English

Auth0规则-从getUser()读取元数据

[英]Auth0 rules - read metadata from getUser()

I'm using Auth0 rules to add some info to the user profile. 我正在使用Auth0规则向用户个人资料添加一些信息。 When reading the profile from the web app: 从网络应用读取配置文件时:

$userInfo = $auth0->getUser();

the data added by the rules does not seem to be there. 规则添加的数据似乎不存在。 Is there another method to get the metadata? 还有另一种获取元数据的方法吗?

$auth0->getUserMetadata();

is there but returns 'undefined index' 在那里但返回“未定义索引”

Aha, it appears that you need to call 啊哈,看来您需要打电话

auth0.users.updateUserMetadata(user.user_id, user.user_metadata)

in the rule .js before the getUserMetadata() will return metadata to your app. 在getUserMetadata()之前的规则.js中,会将元数据返回到您的应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM