Step-by-Step NextJS Auth Setup with AWS Cognito

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

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

  • @DilwarHossainNoorChandan
    @DilwarHossainNoorChandan 25 дней назад +1

    Fantastic! You saved my one week in only one hour. Gracious 🎉

    • @alexrusin
      @alexrusin  25 дней назад +1

      Great to hear! I'm glad I could help.

  • @qasimqadrii
    @qasimqadrii 22 дня назад +2

    Wonderful, thank you sharing this, love the cognito server actions, will help alot.
    Tutorial request: would you mind creating a tutorial on turbo repo with shared shadcn components library between two nextjs projects, there are not enough information about that, would really appreciate that 🙏

    • @alexrusin
      @alexrusin  19 дней назад +1

      Thank you for the suggestion. Frankly speaking, I'm thinking about pivoting more into AWS. Doing tutorial on turbo repo is definitely a good idea as well.

  • @ReensBeanDip
    @ReensBeanDip 26 дней назад +2

    Could you help me understand how this is safe to use on the front end? Since it’s a client component, wouldn’t the envs be visible on the front end?

    • @alexrusin
      @alexrusin  25 дней назад

      Envs are user pool and client IDs. They are not secrets and can be stored on the frontend. Cognito's app client also has a secret. That secret should be stored securely on the backend.

  • @veljkomaksimovic
    @veljkomaksimovic 19 дней назад +2

    Can you explain how to access the user in a server component, I cannot find that anywhere online :/

    • @alexrusin
      @alexrusin  18 дней назад

      I think you can access it the same way we access it in the middleware const user = await authenticatedUser({ request, response });, but instead of request, response object you can put a cookie object as a context. On server side you can get cookies using Next cookies function.

  • @Wisdomica
    @Wisdomica 2 месяца назад +2

    Thank you! One quick question, where is the full implementation repository? I only found the base project

    • @alexrusin
      @alexrusin  2 месяца назад +1

      You are welcome! There are different branches in the repository corresponding to the parts of the video. The full implementation will be here: github.com/alexrusin/nextjs-cognito-auth/tree/5-reset-password-end

  • @Ziggy0120
    @Ziggy0120 15 дней назад +1

    would it be possible to use cognitos self hosted UI for this?

    • @alexrusin
      @alexrusin  12 дней назад

      You can use Cognito hosted UI, but not for this. Amplify package is used to help host your own UI rather than use Cognito's. Also, the flow will be a little bit different.

  • @isaacowolabi6688
    @isaacowolabi6688 9 дней назад

    Hi Alex, really comprehensive video. I have an issue, even after setting autoSignIn as true after confirmSignUp is called and next step is COMPLETE_AUTO_SIGN_IN. when I call authoSignIn(). i get this error "The autoSignIn flow has not started, or has been cancelled/completed."

    • @alexrusin
      @alexrusin  6 дней назад

      Thank you. That is strange. I suggest checking your Cognito setup in AWS.

  • @johnmukendi7650
    @johnmukendi7650 16 дней назад

    i can receive the current auth user on my client side but not on the server ,the user object returns null values ,I don't know what im doing wrong

    • @alexrusin
      @alexrusin  12 дней назад

      Try cloning the reference project from github and see if it works for you. Then you can compare it to your code.

  • @P13N-E
    @P13N-E Месяц назад +2

    Great setup and thank you! however how to set up the httpOnly to true ?

    • @alexrusin
      @alexrusin  Месяц назад +1

      You are welcome!. Sorry, I'm not sure what you are referring to when saying "set up the httpOnly true"

  • @Bharath_Murugan
    @Bharath_Murugan 2 месяца назад +1

    Awesome 🤙

  • @veljkomaksimovic
    @veljkomaksimovic 19 дней назад +1

    Why did you make nav-links.tsx client rendered. Couldn't that have been done on the server?

    • @alexrusin
      @alexrusin  18 дней назад

      Usually navigation is rendered on the client side. I didn't give it a second thought, frankly speaking. You can try generating it server side. However, you will have to get authenticated user server side as well. useAuthUser hook won't work.