supabase-js
supabase-js copied to clipboard
React Native IOS Session Refresh
Bug report
- [X] 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]