Users getting logged out with "Unsuccessful Refresh Token exchange, reused refresh token detected"

未关闭
#1,374 50 条评论 2 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@subhankarmaiti 已经在做这个了。

开始于 2025年12月16日。

  • #1738 来自 @subhankarmaiti —— 已合并

评估

这个 Issue 还没有评估数据。

描述

bug
Checklist
Description

Our usage of Auth0 is pretty simple. After the user has been logged in we just attach the access token to network calls and verify them server side.

const useApi = (): Api => {
  const { getCredentials } = useAuth0()
  const backend = axios.create({ baseURL: apiUri, timeout: 10000 })
  backend.interceptors.request.use(
    async config => {
      const credentials = await getCredentials()
      config.headers["Authorization"] = `Bearer ${credentials?.accessToken}`
      return config
    },

    async error => {}
  )
}  

We have gotten user reports that they get error in title. Our understanding is that this error is unrecoverable so we log the user out and force them to re-authenticate. We have a couple of thousand weekly users and this happens to maybe 2% of them.

One log id as an example:
90020251110035154104236000000000000001223372093331920555

Our top level provider:

<Auth0Provider domain={domain} clientId={clientId}>
      <Main />
</Auth0Provider>
Reproduction

Seems to happen randomly, a few times a week for affected users. So far we've only seen it on iOS.

Additional context

A similar issue happens when we use the react version, for both MacOS, iOS, and Windows devices. We allow overlap for expiring refresh tokens (120 seconds). Our refresh token are set to last one year, and we're currently seeing this multiple times a week for users.

react-native-auth0 version

5.1.0

React Native version

0.81.4

Expo version

Not using expo

Platform

iOS

Platform version(s)

Multiple

主要语言
TypeScript
星标
553
派生
244
平均合并
19 小时
30 天内合并 PR
39

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

auth0/react-native-auth0 的其他 Issue

查看 auth0/react-native-auth0 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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