Nuxt Auth - Postgres.js

Поделиться
HTML-код
  • Опубликовано: 24 июл 2024
  • Integrating a custom next-auth adapter to utilize postgres.js in a Nuxt 3 application that has authentication using Nuxt Auth.
    Resources:
    Repo: github.com/codybontecou/nuxt-...
    nuxt-auth: sidebase.io/nuxt-auth/getting...
    postgresjs: github.com/porsager/postgres
    pgmg: github.com/JAForbes/pgmg
    postgresql: postgresql.org
    postgresjs adapter PR: github.com/nextauthjs/next-au...
    My Links:
    🔔 Newsletter: www.codybontecou.com/
    📁 GitHub: github.com/codybontecou/
    🤖 Website: www.codybontecou.com/
    🐦 Twitter: / codybontecou
    0:00 Intro
    00:47 Installation + Setup
    02:23 Nuxt Auth Endpoint
    05:38 Environment Variables
    09:00 Postgres.js Auth Adapter
    12:03 Postgres,js initialization
    14:11 PostgreSQL Database
    14:25 Client-side Auth
    16:40 Database Migration
    25:13 Dependency Issue
    29:25 Success!
  • НаукаНаука

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

  • @iUmerFarooq
    @iUmerFarooq 3 месяца назад +1

    Thanks for awesome tutorials 💚💚

    • @codybontecou
      @codybontecou  3 месяца назад

      Slowly but surely getting content out!

  • @CorleoneMikele
    @CorleoneMikele 3 месяца назад +1

    Hello, maybe you can tell me how to implement dynamic changes to Session.expires. So that there is an opportunity from the client part in the signIn("credentials") method using the checkbox to select Session.expires = "Session" and some number of seconds specified in the settings.

    • @codybontecou
      @codybontecou  3 месяца назад

      Hey Corleone, take a look at this guide from next-auth: next-auth.js.org/v3/tutorials/refresh-token-rotation
      Specifically, the JWT callback logic has a accessTokenExpires value you should be able to adjust.

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

    Oh I really wished I found this one month ago.... (but I moved to lucia-auth which has porsager/pg)

    • @codybontecou
      @codybontecou  Месяц назад

      Nice! Are you using lucia-auth with Nuxt?

    • @edhahaz
      @edhahaz Месяц назад

      ​@@codybontecou Using it with Next and Microsoft SSO, it's supported although it wasn't as straight forward as I would've liked. I had to glue it together from their docs on ms-sso, the github example and Microsoft's official ID token claims reference.