TypeError:无法读取react-native-app-auth中未定义的属性“ authorize”

时间:2019-07-10 17:55:28

标签: react-native oauth-2.0

我试图在我的本机应用程序中加入react-native-app-auth,但是每当我使用方法(例如授权或撤消)时,都会出现以下错误

TypeError:无法读取未定义的属性“授权”。

enter image description here

这是我的代码

import { authorize } from 'react-native-app-auth'; accessTokenRequest = async () => { const config = { issuer: 'http://localhost:8080', clientId: 'am.identity.bpss.com', redirectUrl: 'http://localhost:3000/oauth-redirect', scopes: ['read','write'], usePKCE: true, serviceConfiguration: { authorizationEndpoint: "http://localhost:8080/oauth/authorize", tokenEndpoint: "http://localhost:8080/oauth/token", revocationEndpoint: "" }, }; // use the client to make the auth request and receive the authState try { const result = await authorize(config); console.log(result); } catch (error) { console.log(error); } }

当单击登录按钮时,将调用此功能。

这是我的package.json

enter image description here

0 个答案:

没有答案