Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native IOS Session Refresh #1203

Open
1 of 2 tasks
Garett-MacGowan opened this issue Jun 4, 2024 · 1 comment
Open
1 of 2 tasks

React Native IOS Session Refresh #1203

Garett-MacGowan opened this issue Jun 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Garett-MacGowan
Copy link

Garett-MacGowan commented Jun 4, 2024

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Session refresh works fine on android, but will fail on IOS if the app is backgrounded/inactive for too long.

To Reproduce

Implement refresh logic per the docs

import { AppState } from 'react-native'

// make sure you register this only once!
AppState.addEventListener('change', (state) => {
  if (state === 'active') {
    supabase.auth.startAutoRefresh()
  } else {
    supabase.auth.stopAutoRefresh()
  }
})

Wait for ~1 hour, notice that user is no longer authenticated.

Expected behavior

Session refresh should work.

System information

  • Version of supabase-js: [e.g. 2.43.4]
  • Version of Node.js: [e.g. 18.18.0]
@Garett-MacGowan Garett-MacGowan added the bug Something isn't working label Jun 4, 2024
@Garett-MacGowan
Copy link
Author

The logic above stops auto refresh when app goes into background. Still, I think IOS will kill the background process after a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant