powersync-ja / powersync-js

SDK that enables local-first and real-time reactive apps with embedded SQLite for JavaScript clients, including React Native and Web
https://www.powersync.com
Apache License 2.0
321 stars 24 forks source link

Getting auth error [Error: Closed. Original cause [Error: [AUTHORIZATION] Authorization failed Generate a new JWT secret on Supabase #366

Open vaibhavbucchaSureworx opened 4 weeks ago

vaibhavbucchaSureworx commented 4 weeks ago

While authentication we are getting success but that auth session isn't persist we are getting logged out immediately and getting following error.

[PowerSyncRemote] [Error: Closed. Original cause [Error: [AUTHORIZATION] Authorization failed Generate a new JWT secret on Supabase. Cause: unrecognized configuration parameter "app.settings.jwt_secret" (severity "ERROR", file "guc.c", line 5710, routine "find_option")].]

I have checked all the variables which we have declared in the .env file all values and keys are correct, Although we are getting defined values as well wherever we are using them.

Chriztiaan commented 4 weeks ago

Hey @vaibhavbucchaSureworx, the first question I would ask is whether your Supabase project had been paused before? You can see in the error the recommendation of generating a new JWT secret on Supabase.

If this is an unreleased product resetting should be safe, otherwise see https://discord.com/channels/1138230179878154300/1288256116408586343/1288612779636428820

Chriztiaan commented 3 weeks ago

Hey @vaibhavbucchaSureworx, any luck with this?

amjadbouhouch commented 1 week ago

Just I wanna mention, I only encounter this error when I connect to my phone's hotspot.

rcasari1987 commented 1 week ago

I had the same issue. In my case, I'm using Supabase but with a third-party authentication integration (Cognito). To fix this error, you just need to change the JWT secret in the settings->api->jwt secret panel