Supabase Postgresql Timeout on Discord Auth Request

Hey there! I'm trying to build my first T3 app and trying to get the auth up and running. I have it connecting to the Supabase PostgreSQL database and am able to connect & push updates to it from the console, but it's timing out on the Discord OAuth authorize call with an "AdapterError" and "write CONNECT_TIMEOUT". I think everything should be configured correctly (Discord redirects, supabase), but I can't figure out what's wrong with the configuration and why the write isn't working. Anyone have any idea of what I'm doing wrong? This is some of what I see in the terminal console: [auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror [auth][cause]: Error: write CONNECT_TIMEOUT databaseaddress.supabase.co:5432 GET /api/auth/callback/discord?code=D5XUX80EzEjGXIc1xzug7pubSIIOkT 302 in 31181ms GET http://localhost:3001/api/auth/error?error=Configuration 500 in 107ms GET /api/auth/error?error=Configuration 500 in 107ms [auth][error] InvalidCheck: pkceCodeVerifier value could not be parsed. Read more at https://errors.authjs.dev#invalidcheck And this is in the client side browser console: (upon load of Discord authorize page) Refused to connect to 'https://infragrid.v.network/wallet/getnodeinfo' because it violates the following Content Security Policy directive: "connect-src 'self' https://status.discordapp.com (upon timeout) GET http://localhost:3001/api/auth/error?error=Configuration 500 (Internal Server Error) Thank you!
Discord Status
Welcome to Discord's home for real-time and historical data on system performance.
Auth.js | Errors
Authentication for the Web
Solution:
Problem solved! The main issue was that I wasn't using the correct Supabase URI! I needed to use the Transaction Pooler address rather than the Direct Connection address.
Jump to solution
2 Replies
Michael
MichaelOP5d ago
Interestingly, in src/server/auth/config.ts at line 52, the db parameter is getting the following error (not sure if it's related) Argument of type 'PostgresJsDatabase<typeof import("/Users/me/code/pov/src/server/db/schema")>' is not assignable to parameter of type 'SqlFlavorOptions'. Type 'PgDatabase<PostgresJsQueryResultHKT, typeof import("/Users/me/code/pov/src/server/db/schema"), ExtractTablesWithRelations<typeof import("/Users/me/code/pov/src/server/db/schema")>>' is not assignable to type 'AnyPostgresDatabase'. The types of '_.session' are incompatible between these types.
Solution
Michael
Michael4d ago
Problem solved! The main issue was that I wasn't using the correct Supabase URI! I needed to use the Transaction Pooler address rather than the Direct Connection address.

Did you find this page helpful?