Request: document best practices for authentication
See original GitHub issueAlmost every app needs authentication, so it would be useful to document recommended patterns.
For example, below I have a user state which indicates whether the user is logged in or not.
Based on that state the app should navigate to either the welcome scene or the tabs scene.
I’ve tried implementing this behaviour with a useEffect, but it’s not firing.
const navigator = new StateNavigator([
{ key: 'welcome' },
{ key: 'tabs' }
])
const { welcome, tabs } = navigator.states
welcome.renderScene = () => <Welcome/>
tabs.renderScene = () => <Tabs/>
const Navigation = () => {
const { user } = useUser()
useEffect(() => {
user ? navigator.navigate('tabs') : navigator.navigate('home')
}, [user, navigator])
return(
<NavigationHandler stateNavigator={navigator}>
<NavigationStack />
</NavigationHandler>)
}
Is there a recommended way of doing this I’m missing?
Any insight is greatly appreciated.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Identity Authentication Best Practices
The authentication methods discussed in this guidance document are intended to serve as examples of best practices, and the provided list of methods...
Read more >6 Authentication Best Practices
1. Prioritize passwordless authentication · 2. Implement federated login and single sign-on (SSO) · 3. Harden authentication functionality · 4.
Read more >Best practices for REST API security: Authentication and ...
Best practices for REST API security: Authentication and authorization · Always use TLS · Use OAuth2 for single sign on (SSO) with OpenID...
Read more >Authentication — Requests 2.28.1 documentation
This document discusses using various kinds of authentication with Requests. Many web services require authentication, and there are many different types.
Read more >Account authentication and password management best ...
13 best practices for user account, authentication, and password management · 1. Hash those passwords · 2. Allow for third-party identity ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No bother, I’m just glad you got it working. You happy to close this?
No luck.
Putting
// @refresh resetin theNavigation.jsfile fixed it.Thanks for holding my hand.