-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Environment
@frontegg/react-native: 1.2.14- Platform: iOS (also check Android)
- React Native: 0.79.2
Problem
When using Hosted Login (WebView) in a React Native app, there are two ways to log in:
- 1. Credentials: Entering email and password in the input field — works fine, including after logout.
- 2. Social login (Google button inside the WebView): Logging in with Google (and possibly other social providers) via the button inside the Hosted Login WebView.
The issue:
If I log in via the Google button inside the Hosted Login WebView, everything works and I am authenticated.
But after I log out (calling logout()), the Login button (or link) in my app becomes inactive — I cannot open the Hosted Login WebView again.
The only way to make the Login button active again is to fully close and reopen the app.
- This does not happen if I log in with credentials (email/password) — in that case, everything works after logout.
- This does not happen if I use direct social login (
directLoginAction('social-login', 'google')) — in that case, everything works after logout. - The problem is only when using the Google button (and possibly other social providers) inside the Hosted Login WebView.
Steps to Reproduce
- Open the app, press "Login" — Hosted Login WebView opens.
- Use the Google button inside the WebView to log in.
- You are authenticated, everything works.
- Press "Logout" in the app (calls
logout()). - Try to press "Login" again — the button/link is inactive, Hosted Login WebView does not open.
- Only after fully closing and reopening the app does the Login button become active again.
What I tried on the frontend
- Clearing all cookies (using both
@react-native-cookies/cookiesandreact-native-cookies) - Clearing AsyncStorage
- Calling
logout()once and even twice - Removing any auto-login logic
- Using the official example from the docs
Nothing helps — the problem persists.
Additional Info
- It looks like the issue is related to the system browser context inside the WebView, which is not the same as the context used for direct social login from the app.
- When using direct Google login (
directLoginAction('social-login', 'google')), everything works perfectly: after logout, the session is cleared and the user can always re-login. - The problem only happens when triggering Google login (and possibly other social providers — please check!) from inside the Hosted Login WebView.
Expected Behavior
After logout, the Login button should always be active, and the Hosted Login WebView should open, allowing the user to log in again (with credentials or social login).
Actual Behavior
After logging out from a social login (Google) inside Hosted Login WebView, the Login button becomes inactive and the user cannot log in again until the app is restarted.
Please advise if there is a workaround or if this is a known issue. Thank you!
