DEV Community

Cover image for Create an Authorization Flow with React-Navigation 5.x

Create an Authorization Flow with React-Navigation 5.x

Embedded Nature on April 11, 2020

Overview React navigation is one of the go to libraries to help build fluid react-native screens. Its easy to setup and is completely cu...
Collapse
 
shehrazjazib profile image
shehrazjazib

Hi Dear, It is a great article to handle authentication with context provider. But I am using redux to manage app state. can you please guide, how i can handle authentication flow with redux.

Thanks in advance.

Collapse
 
ficusd profile image
Tom • Edited

I must have missed something. Not understanding the initialParams signOut bit. I get a warning about "Non-serializable values were found in the navigation state". Still have found your article very informative. Thanks!

Collapse
 
josepatricio profile image
Pato

could you please share the code

Collapse
 
embeddednature profile image
Embedded Nature

Let me create a public repository and I'll share the link.

Collapse
 
embeddednature profile image
Embedded Nature

I've added a repository -> github.com/ICeZer0/NativeAuthApp

Collapse
 
spock123 profile image
Lars Rye Jeppesen

I can't believe React is so messy.. form validations and form handling is really really bad.

We need more Observables built in, working with promises is horrendous in 2020..

Collapse
 
embeddednature profile image
Embedded Nature

Hi Lars, thanks for taking the time to check out my post! You are right, keeping components in sync with state has been an issue. I think hooks has been a good addition to help, It would be interesting to see how other devs handle these scenarios. I find myself developing more defensively to protect against re-renders and side effects, its all a learning experience 😁. Any recommendations for implementing a good obverse pattern? I see many using RxJS, nothing built in though.

Collapse
 
pxk165730 profile image
prutvhiraj

Thank you for the great article. Do you think it’s possible to link this with aws cognito as user Authentication?

Collapse
 
embeddednature profile image
Embedded Nature

Glad you liked it! Yes, Congito would be a good authorization gateway to use. With the AWS library, you could set the user in the Congito user pool then request a token which gets cached and validated using hooks.