【发布时间】:2020-06-05 08:59:16
【问题描述】:
我在我的 React Native Expo 应用程序中使用 AuthSession 以使用 auth0 (following this example) 登录。
async mobileLogin(){
const redirectUrl = AuthSession.getRedirectUrl();
...
}
登录在 Android 和 iOS 上都可以正常工作,当我在 Web 上使用它时,AuthSession 模块会中断:
bundle.js:19465 Uncaught (in promise) TypeError: Cannot read property 'startsWith' of undefined
深入 AuthSession Expo 模块,代码在第 150 行中断 (link to source code on github)。 在expo documentation AuthSession 中应该支持Web,但是对于它的依赖项之一expo-app-auth:
计划添加网络支持
我的猜测是,由于 Web 不支持 expo-app-auth,因此从 Web 使用 AuthSession 会中断(而在移动设备上工作)。这是真的?我是否应该在我的 React Native 应用程序中从网络上寻找另一种使用 auth0 登录的方法?有什么建议吗?
【问题讨论】:
标签: react-native expo auth0