Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Fix OAuth consent page doesn't change after approval

fzaninottoa01f38057897
diff --git a/src/components/supabase/oauth-consent-page.tsx b/src/components/supabase/oauth-consent-page.tsx
index 5cec063a..703174c4 100644
--- a/src/components/supabase/oauth-consent-page.tsx
+++ b/src/components/supabase/oauth-consent-page.tsx
@@ -34,6 +34,7 @@ export function OAuthConsentPage() {
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const [submitting, setSubmitting] = useState(false);
+ const [approved, setApproved] = useState(false);
useEffect(() => {
async function loadAuthDetails() {
@@ -85,7 +86,8 @@ export function OAuthConsentPage() {
setError(error.message);
setSubmitting(false);
} else {
- // Redirect to client app
+ // Show success message and redirect to client app
+ setApproved(true);
window.location.href = data.redirect_url;
}
}
@@ -144,6 +146,25 @@ export function OAuthConsentPage() {
);
}
+ if (approved) {
+ return (
+ <Layout>
+ <div className="flex flex-col space-y-2 text-center">
+ <h1 className="text-2xl font-semibold tracking-tight">
+ {translate("ra-supabase.oauth.approved", {
+ _: "Authorization Approved",
+ })}
+ </h1>
+ <p className="text-muted-foreground">
+ {translate("ra-supabase.oauth.close_tab", {
+ _: "You can now close this tab.",
+ })}
+ </p>
+ </div>
+ </Layout>
+ );
+ }
+
return (
<Layout>
<div className="flex flex-col space-y-2 text-center">