FormidableLabs / FormidableLabs/react-native-app-auth

Logout crash on Android

未关闭
#802 6 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
2.3k
派生
473
PR 合并指标
30 天内没有已合并 PR

描述

Hi to everyone, this is my first issue ever so let me know what can I do in order to give you every needed info. I have a problem with the logout function only on Android.

This is my code:

```
try {
const config = setConfig(authConfig);
const result = await logout(config, {
idToken,
postLogoutRedirectUrl: REDIRECT_URL,
});
return result;
} catch (e: any) {
console.log('logout error', e);
return null;
}
```

When I invoke that method, I get this error that is not caught by my catch block:
![Schermata 2023-01-16 alle 11 29 43](https://user-images.githubusercontent.com/44085676/212657169-1643d274-d819-46ba-8490-2bc56f225bc7.png)

When I remove the id token or the redirect url, the catch works correctly.

This is my config object (I can't share the exact values):

```
{
"redirectUrl": "myAndroidScheme",
"scopes": [
"openid",
"email",
"profile",
"offline_access"
],
"additionalParameters": {
"display": "popup",
"prompt": "login"
},
"clientAuthMethod": "post",
"warmAndPrefetchChrome": true,
"issuer": "myIssuer",
"clientId": "myClientID"
}
```

Here some extra infos:

- "react-native-app-auth": "^6.4.3"
- "react-native": "0.70.6"
- no Expo
- Emulated Android device with Android 10

Thanks!

贡献指南

打开贡献指南

调研方向

在使用 react-native-app-auth 6.4.3 的模拟 Android 10 设备上重现 logout 调用,先同时使用 idToken 和 postLogoutRedirectUrl,然后分别省略其中一个。检查 Android logout 路径和异常处理,并验证错误会得到处理,且在两个参数都存在时 logout 能够完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, javascript, react-native
领域
authentication, mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。