An Incoming Freshman + Web Developer's Setup in mid-2023!

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

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

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

    Hi geniussss, can you please make a video using refresh tokens whit this Google provider on Next-Auth? I need to save it on MongoDB and most importantly, i need to use 2 providers at the same time, i am creating something like Calendly, i mean, the users create their accounts using credentials (email - password) and after that i need to sync their Google Calendar but i don't know how can i do that, oh and i don't really care if it is using nexh-auth or just some api or other library

    • @livecode247
      @livecode247  Год назад +1

      Does this help you by any chance? github.com/nextauthjs/next-auth/issues/408#issuecomment-656701921

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

      ​ @livecode247 i think that it help me a lot but the other thing that it's broking my head it's that how can i access to that (in order to confirm the login or sync to the Calendar) if the session of the users its the credentials one and not the google's one@@livecode247

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

      Haven't done this personally but theoretically how it should work is that if you implement a refresh token rotation(to have the latest refresh token at all times), you could get access to the access token and refresh token using the jwt callback as shown in this link: next-auth.js.org/v3/tutorials/refresh-token-rotation
      Now if you have access to that refresh token, I think you can access the googleapis endpoint. More reference I found over here: github.com/nextauthjs/next-auth/issues/1162#issuecomment-766331341
      If this doesn't help you as well, let me know. I'll look more into it 😊

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

      Honestly, this part of my project have me crazy for the past 2 days. It's like I understand the individual parts, but I'm not sure how to combine them to make it work. Currently, I can create an account with my credentials (corporate email and password). What comes next is, once logged in, I need to sync my Google account. This should also include a refresh token so that users of my Calendly type app can send a link with their availability to schedule consultations. The idea is for this availability to come from my user's Google Calendar. Do you think you could make a video about this? You're the only one who has responded to me. Thanks.@@livecode247