Building an Ionic JWT Refresh Token Flow

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024

Комментарии • 44

  • @masudirachman2324
    @masudirachman2324 3 года назад +2

    Hi Simon, great tutorials... Can you continue with API backend tutorial. Thx a lot...

  • @zer0ne83
    @zer0ne83 3 года назад

    Thanks so much, bro. Recently had a shot at coding my own version of an Auth/Refresh Token module for use with the Deputy API. It was... uh, functional... but suffice to say I still have a lot to learn and your implementation is infinitely superior. Learned a lot and have better code as the ultimate result so thank you again, you and your tutes are a blessing.

  • @kingpinkent
    @kingpinkent 3 года назад +1

    Good tutorial. Though, you don't need an else statement when you always return something in the if statement. You can just put the else logic after the if statement. It makes the code a bit cleaner

  • @sagarbabu662
    @sagarbabu662 3 года назад +1

    Awesome Simon. I learned ionic from your videos only.Could you please make video on the audio and video calling with chat using twilio ionic5. Thank you

  • @victorm9131
    @victorm9131 3 года назад +1

    Thx Simon, will use this in my app

  •  3 года назад +4

    Ionic Framework + Capacitor + Simon: The best! 😎

  • @علياءاسامه-ت4م
    @علياءاسامه-ت4م 3 года назад +1

    Thanks it is awesome

  • @mertellialti
    @mertellialti Год назад

    Hello Simon, Thanks for the content! But I have question. Why do you use canLoad instead canActivate?

    • @galaxies_dev
      @galaxies_dev  Год назад

      This was a long time ago - actually not sure. I think canLoad runs only once while canActivate runs every time, right?

  • @prasadnarayana
    @prasadnarayana 3 года назад

    Love your content 😍 BTW

  • @jhonsoto6515
    @jhonsoto6515 3 года назад

    hello Simon.
    ¿you have implemented
    augmented reality with ionc?.
    I am researching it for a project, ¿do you know if it is possible to do it?

  • @TheSaceone
    @TheSaceone 3 года назад

    Hi Simon, is there a chance we can get the source code of the backend?

    • @galaxies_dev
      @galaxies_dev  3 года назад +4

      Because you're one of the most loyal followers in here I've uploaded the code for you here: github.com/saimon24/nest-token-api-example
      At least I think that's it, haven't found any other code that looked like it :D

    • @TheSaceone
      @TheSaceone 3 года назад

      @@galaxies_dev Thank you very much Simon! Learned some things watching the code, but I wonder how you deploy it. In the procfile you simply run node dist/ but the dist folder is not in the repo (which is good), so I dont understand how heroku can build the app then

    • @tamhuynh772
      @tamhuynh772 3 года назад

      @@galaxies_dev that's for nest, not ionic Simon.

  • @prasadnarayana
    @prasadnarayana 3 года назад +1

    Hi Simon great tutorial 👏👏👏
    Can u make a video on getting updated data by other user with out refresh or recall of same api
    ( May be a Chat result 😉) without firebase collection, using pure rest API call.

  • @ryandekwaadsteniet6371
    @ryandekwaadsteniet6371 3 года назад +1

    Great video. I would suggest a good teaching style is to apply a solution to each stage of the build and demonstrate that segment as you go along. Especially if you tackle harder to grasp subjects! Otherwise a super helpful video, thanks Simon

  • @microvirus
    @microvirus 3 года назад +1

    IONIC is the BEST.

  • @uzairashraf8736
    @uzairashraf8736 3 года назад

    can't you add the git link of this code?

  • @antonshinkarenko
    @antonshinkarenko 3 года назад +1

    thx a lot - you save my days

  • @gonself
    @gonself Год назад

    Hey Simon, thanks for the tuto, is great!
    But I have a question... What happends if refresh token was expired? I recived from my back (laravel) an http 200 with null value, but the application crash...
    Uncaught (in promise): EmptyError: no elements in sequence - from line const refreshToken = from(Storage.get({ key: REFRESH_TOKEN_KEY }));
    I think the best choice is redirect the user to the login screen, can you help me? i don't know how to do that without errors...
    thanks in advanced!

    • @galaxies_dev
      @galaxies_dev  Год назад

      Yeah when loading the token you should always check if it's actually still valid, or otherwise handle the response from your backend which should be 40x if the token is not valid anymore!

  • @GoriAmir
    @GoriAmir 3 года назад

    You actually do the video about this topic that I requested in your 5 Best Practices video. And yes, I am absolutely very happy and excited about this. Finally get to see the correct or more proper way I guess to manage token. Thank you so much! Looking forward for more contents!

  • @adel_dx
    @adel_dx 3 года назад

    Thanks, Simon, Any tutorial about convert videos using any native plugin. then upload to Firebase storage with ionic 5?

  • @TheSaceone
    @TheSaceone 3 года назад +1

    0:41 Overview
    3:08 Api service
    8:22 Login page
    9:31 Inside page
    10:06 Guard
    12:56 Interceptor
    15:15 Me while programming...

    • @galaxies_dev
      @galaxies_dev  3 года назад +2

      Where can I hire you? Added some more timestamps, gonna make this another step in my upload process in the next time..

    • @TheSaceone
      @TheSaceone 3 года назад +1

      @@galaxies_dev hahahaha I do this for myself because in each tutorial you show some hidden gem of ionic or capacitor (probably you don't realize that, but beleive me, you do it) and I find it very useful. For example maybe you explain something about capacitor community plugins that is interesting, like the import for proper working on web, but since the tutorial is about a whole bigger thing, that comment cannot be found easily again. Timestamps help me when I need to find those kind of comments you make, or as I called them before, hidden gems :)

    • @galaxies_dev
      @galaxies_dev  3 года назад +2

      You should keep track of that in a document and create a hidden gem compilation 😍

    • @TheSaceone
      @TheSaceone 3 года назад

      @@galaxies_dev haha good idea!!

  • @exomc
    @exomc 3 года назад

    Could this be used for SSO?

  • @RaffyGarage
    @RaffyGarage 3 года назад

    Hi Simon, I'm writing to ask you a few things, I recently bought a MacBook Air M1, and compiling my project from Chrome with Ionic serve works perfectly, but when I move with Capacitor in Xcode it gives me an infinity of errors.
    what does it depend on, from the fact that I have an M1, am I doing something wrong?
    Thanks for the reply.

    • @galaxies_dev
      @galaxies_dev  3 года назад

      I actually don't know since I don't have M1 yet, but I heard that normally everything works fine :/ did the code previously work on another Mac?

    • @RaffyGarage
      @RaffyGarage 3 года назад

      @@galaxies_dev Sorry Simon, but I had not seen this notification so I reply a little late, I tried on an iMac with High Sierra and Xcode 10.1
      and the errors remain, so I think there will be a need for a minimal version of XCode to get everything to work? At the time of writing I have Ionic 6.13

  • @microvirus
    @microvirus 3 года назад

    we love you

  • @stefanminchev1741
    @stefanminchev1741 2 года назад

    Hey Simon, great video as always! Are you planning to shoot a video with the same token interceptor but using http native instead, could that be interesting?

    • @galaxies_dev
      @galaxies_dev  2 года назад +2

      Yeah might do this in a future episode, good idea Stefan!

  • @desmondawere3409
    @desmondawere3409 3 года назад

    Hi Simon, thanks for this tutorial, I have a quick question. How can i get the payload of the authenticated user after successful login using the stored token?

    • @galaxies_dev
      @galaxies_dev  3 года назад

      You can always decode the token with a simple jwt package (I think angular-jwt)

  • @ammarmahmoud4422
    @ammarmahmoud4422 3 года назад

    Nice tuto ❤❤ . but how can i save user info when i sign in like user_id, type_user and createdBy ...

    • @galaxies_dev
      @galaxies_dev  3 года назад

      You could use Ionic Storage to store them locally!