RLS Authorized isn't working with custom JWT Token
I have built an app that using neon as a database along with Drizzle as the orm.
My app used to work fine before but now I get a TLS error:
I have tried multiple approaches to find a clue:
- I ensured drizzle wasn't the issue atleast without JWT. I can use neonclient with drizzle and it works with DATABASE_URL but when I add the token with the client it then gives the TLS error.
This is my code below for reference:
- I downgraded Postgres from 17 to 15 to check if that was the issue. but it didn't fix it.
- I then read in the document about the serverless driver from 1.0.0 was changing so I downgraded to 0.10.4 along with drizzle-orm from 0.44.1 to 0.39.1 but to no avail.
- My app is hosted on vercel and thought maybe that was the issue. So I spun up a deno app in cloudflare which didn't work too.
- Finally, I created a new neon project to test out if authenticated irl with token would work and still the issue presists.
5 Replies
like-goldOP•3mo ago
I have the same structure as this repo: https://github.com/neondatabase-labs/rls-demo-custom-jwt
GitHub
GitHub - neondatabase-labs/rls-demo-custom-jwt: A demo of Neon RLS ...
A demo of Neon RLS with custom generated JWTs. Contribute to neondatabase-labs/rls-demo-custom-jwt development by creating an account on GitHub.
plain-purple•3mo ago
Can you DM me your project ID and I can take a look in the back end
like-goldOP•3mo ago
Sent!
Hey @Conrad Ludgate I may have been lost in your dm. The error won't go away. How shall I proceed further? We really need to push an MVP with neon out.
@mrl5 I saw the github issue you were attending to and I have the same issue. I can provide more details about it.
deep-jade•2mo ago
you probably meant https://github.com/neondatabase/serverless/issues/167
it was resolved couple days after your message. I guess you're not experiencing issues anymore?
GitHub
Error connecting to database: ConnectionRefused: Unable to connect....
Hi team, I am experiencing this issue all of sudden. Previously it was working well. Error connecting to database: ConnectionRefused: Unable to connect. Is the computer able to access the url? This...
like-goldOP•2mo ago
Haha, I was the one who contacted you in that issue. Thanks again for looking into it : )