Supabase sign-in that expired: say so and offer Connect Supabase again; ask for projects one at a time
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cb56fd11a0
commit
e7c5c8df69
2 files changed
+15
-4
No files matched your search
+10
-1
@@ -110,7 +110,16 @@ export async function mcpSession(): Promise<{ exec: Exec; close: () => Promise<v
|
||||
|
||||
async function connectClient(s: Saved) {
|
||||
const client = new Client({ name: "broke", version: "1.0.0" });
|
||||
await client.connect(new StreamableHTTPClientTransport(new URL(urlOf(s)), { authProvider: provider(s.redirect!) }));
|
||||
try {
|
||||
await client.connect(new StreamableHTTPClientTransport(new URL(urlOf(s)), { authProvider: provider(s.redirect!) }));
|
||||
} catch (e) {
|
||||
// The sign-in expired and couldn't be renewed: forget it, so the page offers Connect Supabase again.
|
||||
if (/unauthori[sz]ed|invalid_grant|401/i.test(e instanceof Error ? e.message : String(e))) {
|
||||
save({ tokens: undefined });
|
||||
throw new Error("Your Supabase sign-in expired. Press Connect Supabase again.");
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user