-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Check if logged in and redirect not working #3449
Comments
same issue im looking for reason |
Hi there, any good soul could help me on that ? async componentDidMount(){ I have the getUserData working fine, GlobalData.userData.LoggedUser comes back set to true
and then I get this [Unhandled promise rejection: TypeError: _reactNativeRouterFlux.Actions.account is not a function. (In '_reactNativeRouterFlux.Actions.account()', '_reactNativeRouterFlux.Actions.account' is undefined)]
|
did u import the {Actions} from 'react-native-flux-router' ? |
also u can do this
` |
Found a workaround. Make Router Class based component, save user logged in state somewhere like I have save in async storage i.e commonData.IsUserLoggedIn In Render method
So when the Router Component is called, it will only show the Login Component if User is not logged in. You can toggle IsUserLoggedIn to 0 or 1 when the user log in or log out. |
Working normally for me, have it as follows:
Where validLogIn is a function returning true/false. |
A couple of things don't work as they used / supposed to (from v1). For instance, To continue using the logic I had previously, I wrapped my rerouting logic inside a |
Hello,
I wrote this code but the there is no redirect to login.
My router is
The RequireAuth is
The function ActionLogin() is not fired and there is no redirect to the login component
Please help
The text was updated successfully, but these errors were encountered: