Login Authentication Tutorial in React Native using AsyncStorage | useReducer, useContext, useMemo

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024
  • In this tutorial, you'll learn how to implement login authentication in react navigation v5 for react native app. I have used AsycStorage, useReducer hook and context API to implement global state management for our authentication.
    GitHub repo for this complete project bit.ly/3dZfb7U
    React Navigation v5 Tutorial Series • React Navigation 5 Tut...
    If you found my tutorials helpful, you can buy me a coffee from this link paypal.me/itzp...
    Follow me on GitHub github.com/itz...
    Subscribe to my Channel bit.ly/2PaUqOk
    For more tutorials on WordPress, React JS, React Native and Digital Marketing visit: www.pradipdebna...

ความคิดเห็น • 249

  • @adamfrank9400
    @adamfrank9400 3 ปีที่แล้ว +10

    What I like most about this video is that you took it in two steps, so that allows me and my team to understand the context api first and THEN the reducer, which IMO are two separate and equally difficult concepts to understand.
    Thanks!

  • @hypersudo8092
    @hypersudo8092 4 ปีที่แล้ว +59

    He covered almost everything in react-navigation version 5. I highly recommend this video for development. lots of learning from it. Thank you so much. Looking more tutorials from you.

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว +2

      Thanks for your comment & support.

    • @hypersudo8092
      @hypersudo8092 4 ปีที่แล้ว +1

      @@itzpradip How can I implement this auth flow with redux??

  • @BrunoCarvalhomCTM
    @BrunoCarvalhomCTM 4 ปีที่แล้ว +9

    Thank you for the tutorial, it was very helpful, even the way that it is presented: you dont just throw codes on our faces, you took the care to explain what each function does and how to use them. Greetings from Brazil!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad it was helpful!

  • @skatelouis6033
    @skatelouis6033 6 หลายเดือนก่อน

    3 years later still saved my ass thank you so much

    • @itzpradip
      @itzpradip  6 หลายเดือนก่อน

      I'm glad that it helped you. 😀

  • @LoFiRadio-tp5tj
    @LoFiRadio-tp5tj 3 ปีที่แล้ว

    Man, thank you!!! You just save my life! I spend about a day read articles, but all of the articles about auth is is not explaining what's happening in details, but with your video I make it just for the 1 our! THAAAAAANX A LOOOOOT!!!!

  • @neerajsaxena8108
    @neerajsaxena8108 4 ปีที่แล้ว +5

    This is by far one of the best tutorials for authentication flow using v5. Amazing work. Keep it up

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว +1

      Wow, thanks!

    • @rajatgoyal8162
      @rajatgoyal8162 4 ปีที่แล้ว +2

      @@itzpradip Hey Bro, your videos are really awesome and you explained each and everything in a very easy way, can you please extend this tutorial and connect this app with firebase (for Authentication and all) please

  • @Yahookudi
    @Yahookudi 4 ปีที่แล้ว +16

    Thank you for your effort. You did a great job and by far, the best and most simplistic tutorial on the internet for this topic!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Wow, thanks!

  • @chaudharypraveen98
    @chaudharypraveen98 3 ปีที่แล้ว

    Thank you so much. You saved me. I searched a lot but unable to find a good resource for beginner learning auth.

  • @chandikalakshan468
    @chandikalakshan468 2 ปีที่แล้ว

    This still useful for me in 2022. Well organised content that I can absorb easily.

  • @ajmalhasan9759
    @ajmalhasan9759 4 ปีที่แล้ว +1

    Sir thank you very much, I am professional react native developer but watching your tutorial for getting knowledge about new RN features. I must say u explained and mentioned everything latest. Thanks again for your great playlist :)

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad to hear that

  • @4You190
    @4You190 2 ปีที่แล้ว +1

    You are the legend of ReactNative thank you for your effort and the way how you explain and simplify it. 👍🏼

  • @jesuserwinsuarez65
    @jesuserwinsuarez65 2 ปีที่แล้ว

    I've been searching the authentication tutorial of react native and this video is the solution! keep up the good work man!

  • @unknownman1
    @unknownman1 4 ปีที่แล้ว +2

    Just discovered your channel and I must admit your videos are great. Thanks

  • @nikhilemmanuelmusic
    @nikhilemmanuelmusic 3 ปีที่แล้ว

    This is the simplest tutorial I found so far. Great job. Thanks a ton.

  • @vigneshlokeshbabu1686
    @vigneshlokeshbabu1686 2 ปีที่แล้ว

    Sir, this is something that I exactly wanted. This is literally saving my life. Thank you so so much.

  • @girishparate6410
    @girishparate6410 3 ปีที่แล้ว +5

    This playlist is amazing.

  • @meven90
    @meven90 3 ปีที่แล้ว

    Thanks , i follow step by step and manage to use jwt token in my react native app ... cheers

  • @ajayb8730
    @ajayb8730 2 ปีที่แล้ว

    Very Very useful video bro! Keep Going ... I'll give my full support !

  • @HelianGamePiano
    @HelianGamePiano 2 ปีที่แล้ว

    Thank you, please allow me to note for my works !
    8:37 - Sign out in DRAWER screen.
    19:35 - Async. 20:51 - explanation.

  • @keld7151
    @keld7151 3 ปีที่แล้ว

    Wonderful tutorial, i'm so glad i found your video.
    I've been struggling for hours, and you're literally the only one that made it simple!
    Thank you so much !!

  • @TheSHQNKS
    @TheSHQNKS 3 ปีที่แล้ว

    I really love your tutorials man. You help me so much as I am a web developper and I'm developping my first ever mobile app thanks to you.

  • @manojgp1991
    @manojgp1991 3 ปีที่แล้ว

    Awesome login authentication sir,
    This video help me to implement my first app login and auth.
    Thanks sir

  • @LADodgerBlue
    @LADodgerBlue 4 ปีที่แล้ว

    I have watched many videos on this topic and yours is the most succinct. Thank you!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Wow, thank you!

  • @alexandr999kulpanov
    @alexandr999kulpanov 2 ปีที่แล้ว

    Thank you so much for the work you have done!💪👍 Your videos are very helpful and informative! Greetings from Ukraine!

  • @artwellnjanji
    @artwellnjanji ปีที่แล้ว +1

    best tutorial ever

  • @sandupaegodage8163
    @sandupaegodage8163 3 ปีที่แล้ว

    you are awesome. I learned a lot. Reaally informative keep up the good work much love from Sri Lanka

  • @chukwuemekaedeh30
    @chukwuemekaedeh30 3 ปีที่แล้ว

    Thank you very much sir. I must confess that your tutorials has really helped me in many projects and i can't thank you enough. Keep the good work going. Meanwhile, on your login tutorials, i would like you to add more details like, how to accept custom fields from the registration page. I want to learn how to collect users country and display name and add them to the firebase console. Please make tutotrial on this.

  • @kevink263
    @kevink263 3 ปีที่แล้ว

    thank you! from Vietnam with love

  • @preetikasingh6611
    @preetikasingh6611 2 ปีที่แล้ว

    Awesome Learning. Thank you so much for this gift !! Greetings !!

  • @chiderapaulugwuanyi9843
    @chiderapaulugwuanyi9843 4 ปีที่แล้ว +1

    Thank you so much for this. It really helped to clarify things for me in react Navigation v5.

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad it helped!

  • @jaydeepdas9326
    @jaydeepdas9326 4 ปีที่แล้ว

    thinks from making this video...I will gain lot of knowledge.. from ur video

  • @NickKubde
    @NickKubde 3 ปีที่แล้ว +1

    Really again Lucky to have you for this tutorial

  • @jidnyeshaj9219
    @jidnyeshaj9219 3 ปีที่แล้ว

    Cant thank you enough. Thanks man for such a clean explaination

  • @grkraogajini6027
    @grkraogajini6027 4 ปีที่แล้ว +1

    Nice concept explaining us, thank you . And we need more tutorials from you

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Thanks, keep supporting for more tutorials like this.

  • @jaysolanki593
    @jaysolanki593 3 ปีที่แล้ว

    You are awesome.... Saved my heap of days.

  • @FabianD1991
    @FabianD1991 2 ปีที่แล้ว

    Thank you so much !! great tutorial.

  • @AhsanAli-gg7tk
    @AhsanAli-gg7tk 3 ปีที่แล้ว

    Nice teaching Sir, I g through all the tutorials of mosh but can't implement the authentication, now I implemented the authentication working fine,
    Also If you do some code into different files it will understandable good

  • @vishoodicooray2389
    @vishoodicooray2389 3 ปีที่แล้ว

    Thank you very much. I learned a lot of things from this video list

  • @reycerio7465
    @reycerio7465 2 ปีที่แล้ว

    Thank you Pradip.

  • @thanhtrungvu8895
    @thanhtrungvu8895 3 ปีที่แล้ว

    Thank you so much! This is what i'm looking for and my code worked!!

  • @akashkumarmishra5260
    @akashkumarmishra5260 4 ปีที่แล้ว +5

    can you make one more tutorial with a sample API?
    I am not getting this point,, whether we have to call our API from signInScreen or App.js , if we call our API in app.js then how can we handle error handling like, no account found or incorrect password.
    If you can make another tutorial on this, then it will be really helpful

    • @yeguacelestial8304
      @yeguacelestial8304 3 ปีที่แล้ว

      I connected this interface with a Python Flask API, and I think it's a best practice to call to your API from each Screen, using useState, helpers and whatnot.
      You can have your own config.js with your endpoint URL, and then export it to your screens. That's what I did.
      And if you use Expo or you struggle making requests to your API, use ngrok for echoing your local server to Internet. It's very simple to setup.
      Cheers!

  • @rudraItSolutions2299
    @rudraItSolutions2299 3 ปีที่แล้ว +2

    Can explain me how can I use redux store in my app after login using react navigation 5 with authcontext and
    there is possibility I can use authcontext in different module and import to app.js file
    I confuse how can I manage all auth and main app store in app
    thank you for your help.

  • @jagdish_2326
    @jagdish_2326 4 ปีที่แล้ว

    you are too good for teaching concepts.

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad you think so!

  • @techcodification2815
    @techcodification2815 3 ปีที่แล้ว

    That was a great tutorial my friend , thanks for the knowledge

  • @iamamarendra
    @iamamarendra 2 ปีที่แล้ว

    This is very useful for react native custom menu. Can you please create a video for drawer navigator width submenu in react native. Thank you so much.

  • @AkshitSylvester
    @AkshitSylvester 4 ปีที่แล้ว +1

    Hi pradip can you please demonstrate with backend data base authentication for user and token to update global state from mongo db

  • @anuradhaga
    @anuradhaga 4 ปีที่แล้ว +1

    Thank you very much for you nice explanation.
    Could you please create new video about react native and mysql connection step by step (I am new to react native).
    1. Login using mysql database
    2. Upload data into mysql database.
    3. Displaying data from mysql database
    Thank you.

  • @alejandrosorto6827
    @alejandrosorto6827 4 ปีที่แล้ว +2

    Great video! Can you do a tutorial on how to implement IBM Watson services and Microsoft Azure machine learning services to react native apps? There are not many tutorials about these topics out there.

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Great suggestion! I'll try to do these in future.

  • @wasilislam6663
    @wasilislam6663 2 ปีที่แล้ว +1

    Thanks man

  • @sumanthegde3766
    @sumanthegde3766 ปีที่แล้ว

    Your Videos are very Useful. Can you make a video on Mobile OTP verification in React Native?

  • @oscarparedez1417
    @oscarparedez1417 3 ปีที่แล้ว +2

    Hi Pradip. I have a question for you: After a user logging in, how can i set the drawer menu's username to be the one captured by the authContext?

  • @cristianecheverria3995
    @cristianecheverria3995 4 ปีที่แล้ว

    This Playlist is pure GOLD!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      WOW! thanks for your appreciation.

  • @shaurtv2856
    @shaurtv2856 3 ปีที่แล้ว

    please make a complete project tutorial using firebase, like books buying and selling app etc.

  • @jiamingtan9756
    @jiamingtan9756 4 ปีที่แล้ว

    Your tutorial is really useful, thank you so much

    • @Ali-jg1ut
      @Ali-jg1ut 4 ปีที่แล้ว

      hey im getting error after this step 18:30 and error is "can't find variable: userName" help pls?

  • @deepanshmakkar5118
    @deepanshmakkar5118 4 ปีที่แล้ว

    Thanks a lot Sir! Your tutorials are helping me a lot!!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad to hear that

  • @codewithmesfin
    @codewithmesfin 3 ปีที่แล้ว

    Thank you, very helpful tutorial.

  • @rushclintakam7621
    @rushclintakam7621 2 ปีที่แล้ว

    Very nice tutorial 😍

  • @melihozgor7927
    @melihozgor7927 4 ปีที่แล้ว

    Excellent job bro,Your videos are very helpful,im waiting for new videos.

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad to hear that

  • @ferilauw
    @ferilauw 4 ปีที่แล้ว +1

    Great jobs sir. It will more perfect if you combine with axios and jwt please.

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Great suggestion!

  • @ManishAtri
    @ManishAtri 4 ปีที่แล้ว

    You are doing great job. Please add google and Facebook auth in the series :)

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว +1

      I'll do it soon.

  • @hassanforever11
    @hassanforever11 4 ปีที่แล้ว

    Find it very useful, Thankyou keep up the good work :)

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad to hear that!

  • @jwf1043
    @jwf1043 4 ปีที่แล้ว

    thanks sir , but can you make a tutorial about making app that can get location info when we took a picture and marked it on gmaps? thanks a lot once again... your explaination was so easy to understand

  • @robertocandales08
    @robertocandales08 4 ปีที่แล้ว

    Excellent video, thank you very much for sharing your knowledge

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      My pleasure!

  • @leolynn89
    @leolynn89 3 ปีที่แล้ว

    Great tutorial, there is just one thing missing: how do you handle signup/signin errors that would occur in the backend and show them to the user with the given structure of code ? I can't find a way to pass the errorMessage in the loginState down to the signup or signin screen.

  • @alimodz6253
    @alimodz6253 4 ปีที่แล้ว

    I love the app design man!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad you like it!

  • @raymondmichael4987
    @raymondmichael4987 4 ปีที่แล้ว

    This is good brother.
    But hopefully you can group well your videos in a numbered manner for those which belong to a Playlist.
    You mentioned several series, upon checking I found videos are not in a clear sequence.
    Btw, yoir teaching and UI are really great, keep up the good work brother.
    Greetings from Tanzania 🇹🇿

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว +1

      Videos are organized in order, you can check it in "react navigation 5 tutorials" playlist

    • @raymondmichael4987
      @raymondmichael4987 4 ปีที่แล้ว

      Pradip Debnath, sure.
      I saw it; one request though, can you work on how to setup android studio from scratch with those avd, I'm very beat here.
      Consider both mac & windows users.
      Greetings from Tanzania 🇹🇿

  • @shuraif8567
    @shuraif8567 3 ปีที่แล้ว +1

    Please make a tutorial on deep-linking with react native

  • @matthewwillis2201
    @matthewwillis2201 2 ปีที่แล้ว

    This was fantastic. What theme/font/style are you using for VScode - I like it a lot!

  • @anirudhmishra3453
    @anirudhmishra3453 4 ปีที่แล้ว

    Awesome Bro .. You clear my doubt Thanks

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad to hear that

  • @tusharraj9785
    @tusharraj9785 4 ปีที่แล้ว

    Thank you love from india.... :)

  • @baselqhawiesh3660
    @baselqhawiesh3660 3 ปีที่แล้ว

    thanks so much for these tutorials , helped alot , i have a question , i working on a project but iam using SQL instead of AsycStorage , meaning my user details will be saved in sql tables
    so do i need to use all those useEffect+useReducer+useMemo ,etc...???
    hoping you can answer me soon , THANKS

  • @paulochaves3612
    @paulochaves3612 4 ปีที่แล้ว

    Great content! Lots of learning from it. Thank you

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad to hear it!

  • @ankitjaishwal2165
    @ankitjaishwal2165 4 ปีที่แล้ว

    You are doing great but Please make a video to elaborate what if i use Firebase for Authentication. I have done the Authentication using firebase but i'm not able to navigate to homescreen after authentication, since i don't have Authentication token in case of firebase.

  • @ATageH
    @ATageH 3 ปีที่แล้ว

    great tutorial, thanks for sharing!

  • @ahsanhussain5161
    @ahsanhussain5161 3 ปีที่แล้ว +1

    Hi Pradeep,
    I am trying to run your code but I am getting this error:
    Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
    Check the render method of App.
    Also my react version is 16.13.1 as opposed to your 16.9.0

  • @Rifzulzul
    @Rifzulzul 3 ปีที่แล้ว

    great explanation bro 👍👍

  • @rajanayel7447
    @rajanayel7447 3 ปีที่แล้ว +1

    Sir could you please tell me how I can implement firebase with this GUI?

  • @44roel44
    @44roel44 4 ปีที่แล้ว

    Subscribed! Thank you for this!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว +1

      Thanks for the sub!

  • @izudeveloper4512
    @izudeveloper4512 3 ปีที่แล้ว

    Your video is awesome; can you please extend it to connect to a Graphql api?

  • @Vihansh0810
    @Vihansh0810 4 ปีที่แล้ว

    Hi Pradip, your explanations is very nice. Can you please clarify the below issue.
    How to show username and password globally using useContext without asyncStorage in home.js?

  • @amonperes1755
    @amonperes1755 4 ปีที่แล้ว

    You're awesome, bro! Very usefull tutorial!!

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad it was helpful!

  • @huandreydesouzapontes9218
    @huandreydesouzapontes9218 3 ปีที่แล้ว

    Thank you

  • @cloudtechyy
    @cloudtechyy 3 ปีที่แล้ว

    Thanks a lot

  • @hestiaproject2942
    @hestiaproject2942 3 ปีที่แล้ว

    can you explain why you are using react memo for the object that will be pass as context?

  • @canismajor1392
    @canismajor1392 3 ปีที่แล้ว

    Thanks, great tutorial. But how can I use that state (e.g. userName) in other components?

  • @shaurtv2856
    @shaurtv2856 3 ปีที่แล้ว

    Thank you, We learned a lot

  • @TechhubIndia
    @TechhubIndia 4 ปีที่แล้ว

    Hi Bro, You are making awesome videos. Please create a videos for
    1- Form for Create, Update and Delete data
    2- Displaying Json data in Datatable with full support of Filters, Pagination and sorting.

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Thanks for your suggestions. I'll try to do these in future.

  • @mattiacolaci7211
    @mattiacolaci7211 3 ปีที่แล้ว +1

    I have a question, if i would use instead a API call to do the login how i can write that? Thanks you

    • @meerapatel183
      @meerapatel183 3 ปีที่แล้ว

      I tried this out, and it's pretty much the same as he does it except replace the lines
      const userToken = String(foundUser[0].userToken);
      const userName = foundUser[0].username;
      with a fetch request to your server. You can then store and dispatch the token that the server returns. For me the fetch request looked like the below, where the user contains email and password. I added some conditions on the server side to send back 401 status if the username/password was invalid hence the checking of the status once I get a response back.
      function fetchToken (user) {
      return fetch(url + '/users', {
      method: 'POST',
      headers: {'Content-Type':'application/json'},
      body: JSON.stringify(user)
      })
      .then(res => res.status > 401 || res.status == 400 ? Promise.reject(res) : res)
      .then(res => res.status !== 401 ? res.json() : res.text());
      }

  • @albnayem8652
    @albnayem8652 3 ปีที่แล้ว

    Thanks!

  • @verdipratama
    @verdipratama 4 ปีที่แล้ว +2

    thank you sir, please make tutorial role based auth admin and user :(

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว +1

      Thanks for your suggestion. I'll try to do this in future

    • @raymondmichael4987
      @raymondmichael4987 4 ปีที่แล้ว

      Pradip Debnath, that will make this series thw most complete of them all regarding authentication flow.
      Hoping you'll make it happen soon.
      Greetings from Tanzania 🇹🇿

  • @unknownman1
    @unknownman1 4 ปีที่แล้ว +1

    can you use firebase for storing data ??

  • @ReactSinghCoder
    @ReactSinghCoder 3 ปีที่แล้ว

    thank you so much sir

  • @zakirbangash3185
    @zakirbangash3185 2 ปีที่แล้ว

    appreciated Man

  • @exlntsoftwarellc4287
    @exlntsoftwarellc4287 3 ปีที่แล้ว

    @Pradip Debnath - Great tutorial. I watched the whole series and you explained it really well. I followed and implemented all of your code until video #7 in the series. After that I added in my firebase authentication code. In the SignIn screen on the button click I call my firebase login method. Soon as I implemented that code, I keep getting this error: "Error: Rendered fewer hooks than expected. This may be caused by an accidental early return statement.
    " Any ideas on how to resolve this error?

  • @amirnazir2998
    @amirnazir2998 3 ปีที่แล้ว

    I have follwed the same step but i got an errors that is "TypeError: undefined is not an object (evaluating 'loginState.isLoading')"?

  • @dinaligamage2191
    @dinaligamage2191 3 ปีที่แล้ว

    please make a video about react-native paypal integration

  • @arypratama3471
    @arypratama3471 4 ปีที่แล้ว

    Great content, thank you very much... you are amazing

    • @itzpradip
      @itzpradip  4 ปีที่แล้ว

      Glad to hear that! Thanks

  • @eeek4368
    @eeek4368 3 ปีที่แล้ว

    Thank you for your effort!

    • @itzpradip
      @itzpradip  3 ปีที่แล้ว

      My pleasure!

  • @souradeepmajumdar4167
    @souradeepmajumdar4167 3 ปีที่แล้ว

    you are awsome!!!!!!

  • @DavorMiketa
    @DavorMiketa 3 ปีที่แล้ว

    Great content, thank you man. Any chance you make video on php - mysql registration and authentication, optionally together with social registration (fb, google). I'm trying to connect mobile app with existing php backend. Thanks!!