react-native - Realm React-Native Auth0:提供的凭据无效或用户不存在
问题描述
我开始使用 Realm 不久,我正在尝试使用各种教程和文档在我的 RN 应用程序中集成身份验证工作流程。(到目前为止,我一直在使用昵称提供程序)。
所以目前,从应用程序中,我可以点击登录,设置我的电子邮件/密码,该用户将被发送到 auth0。但我无法将该用户添加到我的领域。并继续出现该错误:
"{"type":" https://docs.realm.io/server/troubleshoot/errors#invalid-credentials ","title":"提供的凭据无效或用户不存在。","status" :401,"detail":"jwt 格式错误","code":611}"
这是我的登录功能:
login = () => {
auth0.webAuth
.authorize({
scope: Config.AUTHO_SCOPE,
audience: Config.AUTH0_AUDIENCE,
device: DeviceInfo.getUniqueID(),
prompt: "login"
})
.then(res => {
console.log("res: ")
console.log(res)
auth0.auth
.userInfo({
token: res.accessToken
})
.then(data => {
//Error is here
const user = Realm.Sync.User.login(SERVER_URL, Realm.Sync.Credentials.jwt(res.accessToken))
this.onAuthenticated(data);
})
.catch(err => {
console.log("err: ");
console.log(JSON.stringify(err));
});
SInfo.setItem("accessToken", res.accessToken, {});
SInfo.setItem("refreshToken", res.refreshToken, {});
})
.catch(error => {
console.log("error occurrdzz");
console.log(error);
});
};
我确定我犯了错误,我认为我没有得到使身份验证工作的所有步骤..
无论如何,谢谢大家的帮助,我希望我已经足够精确了!
解决方案
推荐阅读
- reactjs - React-Intl 同时使用多个语言环境
- flutter - StreamBuilder 快照 ConnectionState.done 不起作用
- python - 导航栏中的 Django 动态菜单
- javascript - PayPal 智能按钮交易显示错误
- javascript - 创建一个导入和修补另一个的 javascript 模块
- go - 如何使用光纤将密码解析为字节数组
- ruby-on-rails - html_safe 和非 html_safe 连接
- php - 让 Expression Engine v 2.5.5 与 PHP7 一起使用的最快方法
- docker - 在 github 操作中使用 docker 进行纱线测试永远不会完成
- python - 如何在python中保存和重用处理null的函数