Я пытаюсь включить response-native-app-auth в мое приложение native native, но всякий раз, когда я использую методы (скажем, авторизация или отзыв), я получаю следующую ошибку
TypeError: Cannot read property 'authorize'из неопределенного.
введите описание изображения здесь
вот мой код
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);
}
}
иль вызывать эту функцию, когданажата кнопка входа в систему.
вот мой пакет. json
введите описание изображения здесь