Sakura Dev
Sakura Dev
  • 88
  • 1 084 074
NestJS Full Course #16: Refresh Token
This video is about adding a refresh token feature to a NestJS project. It starts with explaining the difference between access tokens and refresh tokens. Then, it shows how to create a refresh token and send it back to the client along with the access token. The video also covers how to create a refresh token API and a refresh token strategy. Finally, it demonstrates how to use the refresh token to get a new access token. Here are some key points from the video:
Difference between access tokens and refresh tokens: Access tokens are short-lived JWTs used to access protected resources, while refresh tokens are long-lived JWTs used to obtain new access tokens.
Creating a refresh token: The video shows how to create a refresh token with a different secret key and expiration time than the access token.
Refresh token API: The video creates a refresh token API that uses a refresh token strategy to validate the refresh token and create a new access token.
Refresh token strategy: The video creates a refresh token strategy that extracts the refresh token from the request header, validates it, and returns the user ID.
Testing the refresh token: The video demonstrates how to use the refresh token to get a new access token and use it to access a protected resource.
Chapters:
0:00 Intro
0:15 What Is Refresh Token
2:48 Creating Refresh Token
3:42 Refresh JWT Configs
9:50 Refresh Token Strategy
12:50 Refresh Auth Guard
13:37 Refresh Token API
15:35 Testing
zhlédnutí: 94

Video

NestJS Full Course #15: JWT Access Token Authentication
zhlédnutí 160Před 2 hodinami
In this video, you'll learn about JWT Authentication in NestJS. It's part 15 of a NestJS full course. Chapters: 0:00 Intro 0:13 Installing The Dependencies 1:48 Configuring The JWT Module 4:18 ENV Variables 5:16 Config Service 8:25 Creating a JWT Token 13:26 JWT Strategy 19:00 JWT Auth Guard 20:14 Protecting GetProfile Route 24:19 Recap
NestJs Full Course #14: Authentication
zhlédnutí 211Před 7 hodinami
In this episode of the NestJs Full Course, we dive into user name and password authentication using passport.js. Learn how to implement passport local authentication in your NestJs project and enhance the security of your application. Don't forget to like, subscribe, and hit the notification bell for more educational content on authentication in NestJs. #passport.js #nestjs #authentication Cha...
NestJS Full Course #13: Hashing
zhlédnutí 215Před 14 hodinami
In this video, we turn our focus on authentication and authorization in NestJS. We will start by creating a user module and leveraging the power of database triggers to hash the user password. This is the first episode of a series on authentication and authorization in NestJS, so stay tuned for more! Here are some additional details about the video: We will create a user module with a controlle...
Nest JS Full Course #12: ENV and Config Module
zhlédnutí 222Před 16 hodinami
This video is about accessing environment variables in NestJS applications. I start by introducing the problem of accessing environment variables in NestJS and explain that it can be done using the config module. I then demonstrate how to install and configure the config module in a NestJS project. I also discusses some best practices for organizing configurations, such as creating custom confi...
NestJs Full Course #11: Pagination
zhlédnutí 270Před 19 hodinami
This video describes how to implement pagination in a NestJS application. Pagination is a technique that allows you to fetch data in smaller chunks, rather than all at once. This can improve performance and reduce server load, especially when dealing with large datasets. In this video, we will learn how to implement pagination for a property API. We will start by creating a DTO (Data Transfer O...
NestJs Full Course #10: TypeORM Seeding
zhlédnutí 221Před 21 hodinou
This video is part 10 of a NestJS full course on TypeORM Seeding. In this course, you will learn how to use TypeORM to seed your database with initial data. GitHub Repo(Please Give It a Star⭐ on GitHub): github.com/vahid-nejad/nestjs
NestJs Full Course #9: Many To Many Relationships with Type ORM
zhlédnutí 234Před dnem
Dive deeper into the world of NestJS and TypeORM with this comprehensive tutorial on Many To Many relationships. Learn how to effectively model and manage complex data structures where multiple entities can be associated with each other. This video will cover: Understanding Many To Many relationships and their use cases Implementing Many To Many relationships using TypeORM Best practices for ha...
NestJs Full Course #8: One To Many Relationship in Type ORM
zhlédnutí 235Před dnem
In this part of the NestJs full course, we dive into one-to-many relationships, a fundamental concept for structuring data in your applications. One-to-many relationships model scenarios where a single entity can be associated with multiple related entities. Understanding them is crucial for building robust and scalable NestJs applications. We'll walk you through the process of setting up a one...
NestJs Full Course #7: One To One Relations
zhlédnutí 169Před dnem
Conquer One-to-One Relationships in NestJS! This video is your one-stop guide to mastering One-to-One relationships in NestJS. We'll break down everything you need to know, from setting them up to entity mapping strategies. In this video, you'll learn: 1- How to configure One-to-One relationships in NestJS 2- Entity mapping best practices 3- Database relationship management techniques 4- Level ...
NestJS Full Course #6: CRUD
zhlédnutí 351Před 14 dny
NestJS Full Course: CRUD with TypeORM Repository Pattern Hey guys, welcome back to the NestJS full course! Today, we're diving into CRUD operations using the TypeORM repository pattern. So, TypeORM gives us two ways to handle CRUD: query builder and repository pattern. This video focuses on the repository pattern. Basically, TypeORM creates a repository class for each entity in your database sc...
NestJS Full Course 2024 #5: TypeORM
zhlédnutí 402Před 21 dnem
Setting Up TypeORM for NestJS with PostgreSQL Learn how to effortlessly integrate TypeORM into your NestJS application and connect to a PostgreSQL database. In this comprehensive tutorial, Sakura Dev guides you through the entire setup process, from project creation to entity definition and database table creation. Key topics covered: * Understanding TypeORM and PostgreSQL * Creating a new Nest...
NestJS Full Course #4: Dependency Injection
zhlédnutí 355Před měsícem
Dive Deep into Dependency Injection in NestJS (Part 4) Level up your NestJS skills with dependency injection! In this video, we'll explore dependency injection (DI), a powerful technique for building cleaner, more maintainable NestJS applications. We'll cover: - The separation of concerns: Learn how to move complex logic from controllers to services, promoting better code organization. - Invers...
NestJs Full Course #3: Headers Access and Validation
zhlédnutí 360Před měsícem
This video is part 3 of a NestJS full course and covers how to access headers and also headers validation in NestJS applications. we are going to create a custom decorator for headers validation. GitHub Repo(Please Give It a Star⭐ on GitHub): github.com/vahid-nejad/nestjs
NestJs Full Course 2024 #2: Validation In NestJs (ZOD Included)
zhlédnutí 1,1KPřed měsícem
This video is part two of a NestJS full course and covers validation in NestJS applications, including using Zod. Here are the key points covered in the video: Transform Pipes: Used to automatically transform the type of request parameters or query strings. Examples include parseIntPipe to convert a string to a number and parseBoolPipe to convert a string to a boolean. Validation with Class Val...
NestJS Full Course 2024
zhlédnutí 2,1KPřed měsícem
NestJS Full Course 2024
Stripe Online Payments In Next JS 14 - Full Guide
zhlédnutí 1,5KPřed 2 měsíci
Stripe Online Payments In Next JS 14 - Full Guide
Search Bar With useDebounce - Next.JS 14 Full Stack Real Project - Part 9
zhlédnutí 2,4KPřed 2 měsíci
Search Bar With useDebounce - Next.JS 14 Full Stack Real Project - Part 9
Pagination In Server Components - Next.JS 14 Full Stack Real Project - Part 8
zhlédnutí 1,3KPřed 2 měsíci
Pagination In Server Components - Next.JS 14 Full Stack Real Project - Part 8
Landing Page -- Next.JS 14 Full Stack Course With Real Estate Project - Part 7
zhlédnutí 379Před 2 měsíci
Landing Page Next.JS 14 Full Stack Course With Real Estate Project - Part 7
Parallel And Intercepting Routes: Next.JS 14 Full Stack Real Estate Project- Part 6
zhlédnutí 649Před 2 měsíci
Parallel And Intercepting Routes: Next.JS 14 Full Stack Real Estate Project- Part 6
Delete Property and useFormStatus: Next.JS 14 Full Stack Real Estate Project- Part 5
zhlédnutí 481Před 2 měsíci
Delete Property and useFormStatus: Next.JS 14 Full Stack Real Estate Project- Part 5
Authentication and Authorization: Next JS 14 Full Stack Real Estate Project- Part 4
zhlédnutí 1,5KPřed 2 měsíci
Authentication and Authorization: Next JS 14 Full Stack Real Estate Project- Part 4
Next.JS 14 Full Stack Project: Part 3 - Update Real Estate Property
zhlédnutí 880Před 2 měsíci
Next.JS 14 Full Stack Project: Part 3 - Update Real Estate Property
React Compound Pattern and Context API
zhlédnutí 789Před 2 měsíci
React Compound Pattern and Context API
Level Up Your TypeScript: as vs. satisfies vs. Type Annotations
zhlédnutí 433Před 2 měsíci
Level Up Your TypeScript: as vs. satisfies vs. Type Annotations
NextJS 14 Full Stack | Real Estate Project Clone | Part 2
zhlédnutí 1,7KPřed 3 měsíci
NextJS 14 Full Stack | Real Estate Project Clone | Part 2
Unlock the Power of Nested Types in Prisma (For Cleaner Code!)
zhlédnutí 638Před 3 měsíci
Unlock the Power of Nested Types in Prisma (For Cleaner Code!)
🔥 Build & Deploy a Real Estate App with Next Js 14 | Full Stack Project Tutorial [💻📱] Part 1
zhlédnutí 7KPřed 4 měsíci
🔥 Build & Deploy a Real Estate App with Next Js 14 | Full Stack Project Tutorial [💻📱] Part 1
Free Animated React Components for Next.js Projects
zhlédnutí 1,3KPřed 5 měsíci
Free Animated React Components for Next.js Projects

Komentáře

  • @johnattaiyinusa5766
    @johnattaiyinusa5766 Před 7 hodinami

    This video was super helpful!

    • @SakuraDev
      @SakuraDev Před 6 hodinami

      Glad it was helpful! Feel free to ask if you have any questions.

  • @johnattaiyinusa5766
    @johnattaiyinusa5766 Před 7 hodinami

    Great content!

    • @SakuraDev
      @SakuraDev Před 6 hodinami

      Thanks! I'm glad you enjoyed it.

  • @owaissurferaccount
    @owaissurferaccount Před 8 hodinami

    Thank you so much, NextJS Auth explained well with external BE... amazing

    • @SakuraDev
      @SakuraDev Před 6 hodinami

      I'm glad you found it helpful! Combining it with an external backend adds a layer of complexity, but understanding the core concepts is crucial.

  • @turokII
    @turokII Před 19 hodinami

    This is a great tutorial, thank you for all your hard work!

    • @SakuraDev
      @SakuraDev Před 6 hodinami

      You're very welcome! I'm glad you found the tutorial helpful. Creating valuable content is my passion, so hearing positive feedback is incredibly rewarding. If you have any questions or need further assistance, feel free to ask!

  • @starrynight72
    @starrynight72 Před 21 hodinou

    at 9:20 it says when users click the second page of pagination, the page param will be number one. But at 13:36, when you click page 2 of pagination, the pagenum value of the URL searchParam turns to be 2 which is different from what you said at 9:20. This confuses me a bit. And I think maybe the pagenum starts from 1 would be better, right?

  • @pain2theworld612
    @pain2theworld612 Před dnem

    In CreateUserProfile section you can also replace id with +id so it will convert the string to number

    • @SakuraDev
      @SakuraDev Před 5 hodinami

      Thanks for the heads up!

  • @kristianlavigne8270

    It is bad practice to declare types like this in a ts file. Better to add it in a d.ts file. For Sveltekit, I had to add declare namespace NodeJS and interface ImportMetaEnv in the app.d.ts file under the declare global block (for anyone on SvelteKit)

  • @mahamathassan6153
    @mahamathassan6153 Před dnem

    Thank you for your effort , but I have a question can I create a many-to-many without creating the one-to-many first?? what if I only have many-to-many relation!!

    • @SakuraDev
      @SakuraDev Před 5 hodinami

      Thanks. No, you cannot create a many-to-many relationship without the joint table, but type orm and prisma abstract away creating the joint table

  • @yanluisnunezlara319

    Your simple way of explaining and clear pronunciation are very useful for low-intermediate non-native english speakers

    • @SakuraDev
      @SakuraDev Před 5 hodinami

      Thank you! 😃That's great to hear! I'm glad my explanations and pronunciation are helpful. If you have any specific questions or need further clarification on a topic, feel free to ask.

  • @user-dq2bn8pl5u
    @user-dq2bn8pl5u Před 2 dny

    nice

    • @SakuraDev
      @SakuraDev Před 5 hodinami

      Nice to hear! Let me know if you have any other questions.

  • @andrejkling3886
    @andrejkling3886 Před 3 dny

    Awesome lessons…🔥🔥🔥💯 p.s. recording sound looks low… please check it out

    • @SakuraDev
      @SakuraDev Před 3 dny

      Thanks! Will check it out. 🙏🙏🙏🙏🙏

  • @tusharphb6596
    @tusharphb6596 Před 3 dny

    I have been studying this for the past few days. Thank you 😊

    • @SakuraDev
      @SakuraDev Před 3 dny

      Glad you're finding it helpful! Let me know if you have any questions.

  • @qwerty-or1yg
    @qwerty-or1yg Před 3 dny

    How about third party auth?

    • @SakuraDev
      @SakuraDev Před 2 dny

      I will cover them in this course

  • @Coolmoments-gv1mk
    @Coolmoments-gv1mk Před 3 dny

    Thank you 🥳

    • @SakuraDev
      @SakuraDev Před 3 dny

      You're very welcome! Let me know if you need anything else. 😊

  • @Coolmoments-gv1mk
    @Coolmoments-gv1mk Před 4 dny

    Very good explanation. Thank you

    • @SakuraDev
      @SakuraDev Před 3 dny

      You're very welcome! Feel free to ask if you have any other questions.

  • @low_scarlet
    @low_scarlet Před 5 dny

    make next about revoked refreshtoken so after refresh token is revoked then it will end the session

    • @SakuraDev
      @SakuraDev Před 2 dny

      I will do that. revoking is a backend stuff. in the next week I will create a video about that.

  • @xl0xl0xl0
    @xl0xl0xl0 Před 5 dny

    Please cover transactions!

    • @SakuraDev
      @SakuraDev Před 3 dny

      I am planning to create a new version of this course and I will cover transactions

  • @Coolmoments-gv1mk
    @Coolmoments-gv1mk Před 5 dny

    Great course ... thank you for sharing ❤

    • @SakuraDev
      @SakuraDev Před 3 dny

      You're very welcome! I'm glad you found the course helpful. 🙏🙏🙏❤️

  • @madmaxdev
    @madmaxdev Před 5 dny

    please add swagger doc as well

    • @SakuraDev
      @SakuraDev Před 5 dny

      Great idea! Swagger docs would be a fantastic addition. I will add a video for that.

  • @andrejkling3886
    @andrejkling3886 Před 6 dny

    Thank you so very much 🔥✨💯✨

    • @SakuraDev
      @SakuraDev Před 5 dny

      You're very welcome! I'm glad you appreciate it.

  • @renchandara389
    @renchandara389 Před 6 dny

    How can we store data with online database??

    • @SakuraDev
      @SakuraDev Před 6 dny

      We use Prisma in this video, so we jsut need to change our database url in prisma schema

  • @dreamsachiever212
    @dreamsachiever212 Před 6 dny

    great one

  • @nirvanzentinal
    @nirvanzentinal Před 6 dny

    Best

  • @belkocik
    @belkocik Před 6 dny

    What about type safe env (would love to see autocompletion intellisense to my env)

    • @SakuraDev
      @SakuraDev Před 6 dny

      It can easily be done with joi package. I will create an extra episode for this. But at end of course. For now we just turn out focus on authentication

  • @andrejkling3886
    @andrejkling3886 Před 7 dny

    The Best course of Nest js 💯 thank you 🔥

    • @SakuraDev
      @SakuraDev Před 6 dny

      Thank you so much for your support ❤️🙏

  • @andrejkling3886
    @andrejkling3886 Před 7 dny

    Thank you so much for all your self-giving ❤ I saw many courses ... but you created the best course in detail and excellent explanation. Thank you 💯

    • @SakuraDev
      @SakuraDev Před 6 dny

      I'm truly honored by your kind words! Creating a course that truly helps people is my ultimate goal, so it's incredibly rewarding to hear that I've achieved that. Thank you for taking the time to share your feedback. ❤️❤️❤️

  • @andrejkling3886
    @andrejkling3886 Před 7 dny

    Amazing lessons... thank you so very much 🔥💯 TypeORM is excellent tool ... in Sequalize ORM is more complicated

    • @SakuraDev
      @SakuraDev Před 6 dny

      Thanks! Glad you like the TypeORM lessons. It's a great tool.

    • @andrejkling3886
      @andrejkling3886 Před 6 dny

      @@SakuraDev thank you 🙏

  • @nymsurenm
    @nymsurenm Před 7 dny

    thank you

  • @dreamsachiever212
    @dreamsachiever212 Před 7 dny

    loving these series. Keep em coming. It's sad that the views aren't motivating. But you're providing top notch value. I would suggest when the series end please merge all the videos into one single video.

    • @SakuraDev
      @SakuraDev Před 7 dny

      Hi, Thanks for you support. Yeah it's really hard for me to see that these videos don't get views...

  • @TheNaive
    @TheNaive Před 7 dny

    Also how do we detele user but keep there data for some time. Example for week just to know that it's not accidental delete. How to achieve that?

    • @SakuraDev
      @SakuraDev Před 7 dny

      In this case we need to leverage a concept name Soft Delete. Unfortunately Prisma does not offer this feature out of the box but we can implement that manually by adding a deletedAt field in our tables and just update this filed instead of deleting the entire record.

  • @TheNaive
    @TheNaive Před 7 dny

    But I have a doubt while explaining the pagination you used curser, suppose I want to restrict at api level so that no one could query with size say 1000 or 10000, how can we avoid this in next js. directly connected to prisma. I know it can be restricted at nest level but i dont know how to do it with next. Is it even possible to avoid database getting scraped?

    • @SakuraDev
      @SakuraDev Před 7 dny

      we should use zod for validating the page size.

  • @TheNaive
    @TheNaive Před 7 dny

    Great tutorial Thank You

  • @OCEMTechZone
    @OCEMTechZone Před 8 dny

    Great

  • @markjones6894
    @markjones6894 Před 8 dny

    Hi, I know I’ve already asked, but when can we get the supabase auth tutorial? I critically need to implement it 😅 Aside from that keep up the videos they are very informative and well made !

    • @SakuraDev
      @SakuraDev Před 7 dny

      Hi, Of course we will have that video soon after this course. Thank 🙏

  • @naddulidaniel2630
    @naddulidaniel2630 Před 8 dny

    i was waiting for this video. Thank you so much

  • @Deus-lo-Vuilt
    @Deus-lo-Vuilt Před 9 dny

    wow , nice content , like and sub

    • @SakuraDev
      @SakuraDev Před 9 dny

      Thanks for the visit and welcome to this channel ❤️🔥

  • @mohamedyoussef8835
    @mohamedyoussef8835 Před 9 dny

    Awesome tutorial. +++++++++++ 🙂

    • @SakuraDev
      @SakuraDev Před 9 dny

      Many thanks 🙏🙏🙏🙏

  • @onlyman3746
    @onlyman3746 Před 9 dny

    Don’t use typeorm, this orm is not secure use drizzle orm is better

    • @SakuraDev
      @SakuraDev Před 9 dny

      In this course we will use Drizzle ORM as well

  • @andrejkling3886
    @andrejkling3886 Před 10 dny

    Thank you so much 💯

    • @SakuraDev
      @SakuraDev Před 9 dny

      Thank a lot for your constant support

  • @markjones6894
    @markjones6894 Před 11 dny

    Hi I have a quick question. Would it be possible to make a quick video showing how to integrate supabase auth with nestjs and nextjs ? That would be really helpful, thanks

    • @SakuraDev
      @SakuraDev Před 10 dny

      Great suggestion! do you want integrating a postgres database on supabase or file uploading?

    • @markjones6894
      @markjones6894 Před 10 dny

      @@SakuraDev Mainly I want to see supabase auth and how it can be implemented with both nestjs and nextjs but it would also be nice to have supabase database also connected with either Prisma or drizzle. Thank you for your fast reply !

  • @dreamsachiever212
    @dreamsachiever212 Před 11 dny

    Are you going to be using GraphQL approach with prisma? Would love to see more advanced stuff later in the series inlcuding websockets, cron jobs, events... You 're one of the few whose explanation makes complex stuff simple to understand.

    • @SakuraDev
      @SakuraDev Před 10 dny

      Yes of course. I will cover all of these concepts in this course, but as you know, creating videos are really time consuming so I really appreciate your patience. Also I will speedup the uploading episodes this week.

    • @dreamsachiever212
      @dreamsachiever212 Před 10 dny

      @@SakuraDev sure. Looking forward to it. Thanks in advance 🙏🏽

  • @andrejkling3886
    @andrejkling3886 Před 11 dny

    Excellent explanation… thank you 💯

    • @SakuraDev
      @SakuraDev Před 10 dny

      You are welcome! Glad you liked it 🙏❤️

  • @nickwoodward819
    @nickwoodward819 Před 11 dny

    @10:51 - how are you querying categories 'with: {posts:true}', without having to reference the join table? shouldn't it be: `await db.query.categories.findFirst({ with:{ postOnCategories: { with: { posts:true } } } })` I literally can't seem to avoid referencing the otherside of the many to many relationship without the join table? Still a great video, I keep coming back to it over the docs! :)

  • @borooLIVE
    @borooLIVE Před 12 dny

    just thank you! You achieve new spectator!

    • @SakuraDev
      @SakuraDev Před 11 dny

      Thanks for visiting and welcome to my channel 👋

  • @ahmedivy
    @ahmedivy Před 12 dny

    Drizzle >>>>