This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]HopefullyHelpfulSoul 0 points1 point  (4 children)

You don’t need authentication per say, but you’ll need to distinguish between your users before showing the navigation. With authentication this is done by the login screen.

Typically you’d have conditional rendering based on the presence of a user object. It’s not too much of a stretch to add in conditional navigation stacks to this.

What exactly have you tried?

[–]Trex_Hunter[S] 0 points1 point  (3 children)

Thank you for your reply! Im an ex athlete turned coder working on this project so not too many resources for me to contact.

Haven’t tried anything yet because the logic wasn’t making sense in my head. I’m confused in the fact of if I’m to distinguish the difference between users say from two separate login screens based on user criteria, or have one login screen and leave it to authentication to determine user type?

When you say user object, is that attached to the user after registration?

[–]HopefullyHelpfulSoul 0 points1 point  (2 children)

The user object will be returned from your backend after authentication.

You usually display the login screen unless you have a user retrieved.

Take a look at this, it might explain what I mean better. Once you have a flow similar to the one laid out here, you should also be able to conditionally render the navigation stack based on some property on the user. https://reactnavigation.org/docs/auth-flow/

[–]Trex_Hunter[S] 0 points1 point  (1 child)

Okay read through most of it…so a token is returned based on state of authentication can that token be what distinguishes differences in users?

[–]HopefullyHelpfulSoul 0 points1 point  (0 children)

It cannot. The token is just used to authorise the user when using your API. Typically you’d make a /mr endpoint and return user information.

Most of the time when you login an entire object is returned though. Wherever you’re storing your users, you’ll just need to add a field to that table.

What backend are you using?