Source code here: bit.ly/3N9AbMl Subscribe if you like our content!
@joeythompson45309 ай бұрын
Best tutorial I have seen for this! Quick and easy!
@topfeature44929 ай бұрын
Glad to hear! Thanks for your support!
@mr.artist4867 ай бұрын
You saved my day! this is perhaps the best tutorial I have ever seen on this topic!! Thanks a lot!!!!! ❤❤
@topfeature44927 ай бұрын
I'm really glad to read that! And I appreciate your support!
@mr.artist4867 ай бұрын
@@topfeature4492 If possible, can you release a video tutorial on SSDLC (secure software development life cycle) best practices?
@topfeature449210 ай бұрын
Timestamps: 00:00 - Intro 00:13 - Project setup 01:57 - Form creating 03:08 - Firebase setup 04:38 - Work with .env 05:15 - Creating Sign Up and Sign In methods 08:08 - Protected route 12:53 - Creating Sign Out method
@JoshuaIsrael-sl8vtАй бұрын
Your a live saver, this eaxactly what l needed at the moment
@topfeature4492Ай бұрын
Glad to read that!
@ViciaiaTutorial7 ай бұрын
you explained very simple and clear, thanks you for the tutorial!!!!
@topfeature44927 ай бұрын
I'm so happy you found it useful. Thanks!
@ViciaiaTutorial7 ай бұрын
@@topfeature4492 wait to see more from you ^w^
@sethurk8 ай бұрын
Pretty good. Short and precise. Thank you. subbed..
@topfeature44928 ай бұрын
Thanks for your support and subscribed!
@profleadАй бұрын
Nice guide! Thanks!
@topfeature4492Ай бұрын
Welcome!
@ZiedMcHarek16 күн бұрын
Thanks for the great video. What do you think about using the ternary conditional operator? It makes the code a bit clearer. for example {isSignUpActive? Sign Up : Sign In}
@GenosoftTeamGen5 ай бұрын
Great work thank you this is super neat
@topfeature44925 ай бұрын
Thank you for this comment!
@DiogoLScarmagnani5 ай бұрын
Great tutorial, very quick and simple. It works a lot. Got subscribed. I have just one question, please: Don't we need to persist access token in storage for Firebase Authentication?
@topfeature44925 ай бұрын
Glad to be helpful! What exactly storage did you mean?
@DiogoLScarmagnani5 ай бұрын
@@topfeature4492 sorry. I mean localStorage.
@MustafaCanDemir-c4w7 ай бұрын
Hey, great video btw, how to change path when sign in true? For example email and password is true then when i click the button, how to show private page directly
@topfeature44927 ай бұрын
Hi! Thanks for your support! If I got you right, the explanation starts here: 12:09. You need to add to your homepage (or any other public page with Login form) an extra condition to check if a user already logged in (=== if the user exists). If so, Navigate the user to the private page, like this: return UPD Or you can do it directly in the Auth handler function I guess. You can simply create an instance like: const browserHistory = createBrowserHistory() And then just call browserHistory.push(location) after successful login
@Mohit-rl4ct5 ай бұрын
Amazing
@topfeature44925 ай бұрын
Thanks for your comment!
@placek23904 ай бұрын
how isfetching works? i dont understand why adding this magically solve the problem with rendering private page
@topfeature44924 ай бұрын
We render a private route based on the user's existence, and the ProtectedRoute component receives it from the parent component as a prop. The default user value is null, so if we try to access the private page, we will be redirected to the home page because there is no user. After that, let's imagine, the user was successfully set on the state. As we know, this state is defined outside the Routes tree. It means, that the state change will NOT lead to a re-render routes tree. The tree will only update after URL changes. Because of that, the user value inside ProtectedRoute will always be null (withour re-rendering it could not get a new prop value). Even after state changing on the top level. So, my solution here is to render the routes tree only when the user already exists. While we're fetching users asynchronously (isFetching === true) we want to return the loading component (not the routes tree). When the user is fetched we set it to state, then, set isFetching === false, and only after that we are returning a routes tree. It will be the first render and the user value will be correct at this moment.
@xczm2257 ай бұрын
how you guys deal with view flashes when you are logged out and trying to get to any private route? for me it renders component for 0.1 sec and sends you back to '/'
@topfeature44927 ай бұрын
Hi! I tried to reproduce this behavior using my codebase, and everything seems to work correctly. You can compare your code with the following example github.com/from-dev-to-prod/react-firebase-auth Or, please, provide an example and I may be able to help.
@peacemelodi11458 ай бұрын
Nice content are you on Instagram sir
@topfeature44928 ай бұрын
Thank you! Not at the moment, but I’ll post a link when I do
@Abhishek7Shah5 ай бұрын
please can you make vedio of user and admin login in one project