From d341a8ee7445735e8f71cdc4d7aeb1d0544fcbd7 Mon Sep 17 00:00:00 2001
From: Jeff Escalante Missing OAuth consent parameters. Loading consent request... Unable to load consent request.
Missing OAuth consent parameters.
+ } + + if (isLoading) { + returnLoading consent request...
+ } + + if (error || !data) { + returnUnable to load consent request.
+ } + + return ( + + ) + } + + export function OAuthConsentPage() { + return ( +Missing OAuth consent parameters.
+ } + + if (isLoading) { + returnLoading consent request...
+ } + + if (error || !data) { + returnUnable to load consent request.
+ } + + return ( + + ) + } + + export default function OAuthConsentPage() { + return ( +Missing OAuth consent parameters.
+ } + + if (isLoading) { + returnLoading consent request...
+ } + + if (error || !data) { + returnUnable to load consent request.
+ } + + return ( + + ) + } + + function OAuthConsentPage() { + return ( +Missing OAuth consent parameters.
- } - - if (isLoading) { - returnLoading consent request...
- } - - if (error || !data) { - returnUnable to load consent request.
- } - - return ( - - ) - } - ``` + const { data, isLoading, error } = useOAuthConsent({ + oauthClientId: clientId, + scope, + }) - ```tsx {{ filename: 'app/oauth-consent/page.tsx' }} - import { Show } from '@clerk/nextjs' - import type { Metadata } from 'next' - import { Suspense } from 'react' - import { CustomConsentForm } from './custom-consent-form' + if (!clientId || !redirectUri) { + returnMissing OAuth consent parameters.
+ } - export const metadata: Metadata = { - referrer: 'strict-origin-when-cross-origin', + if (isLoading) { + returnLoading consent request...
} - export default function OAuthConsentPage() { - return ( -Unable to load consent request.
} - ``` -Missing OAuth consent parameters.
- } - - if (isLoading) { - returnLoading consent request...
- } - - if (error || !data) { - returnUnable to load consent request.
- } - - return ( - - ) + const { data, isLoading, error } = useOAuthConsent({ + oauthClientId: clientId, + scope, + }) + + if (!clientId || !redirectUri) { + returnMissing OAuth consent parameters.
} - export function OAuthConsentPage() { - return ( -Loading consent request...
} - ``` - - ```html {{ filename: 'index.html' }} - - ``` - - -Unable to load consent request.
} - function CustomConsentForm() { - const clerk = useClerk() - const { search } = useLocation() - const searchParams = new URLSearchParams(search) - - const clientId = searchParams.get('client_id') ?? '' - const redirectUri = searchParams.get('redirect_uri') ?? '' - const scope = searchParams.get('scope') ?? undefined - const redirectHostname = getRedirectHostname(redirectUri) - - const { data, isLoading, error } = useOAuthConsent({ - oauthClientId: clientId, - scope, - }) - - if (!clientId || !redirectUri) { - returnMissing OAuth consent parameters.
- } - - if (isLoading) { - returnLoading consent request...
- } - - if (error || !data) { - returnUnable to load consent request.
- } - - return ( - + ) + } + + export function OAuthConsentPage() { + return ( +{redirectUri}
- Missing OAuth consent parameters.
} - export default function OAuthConsentPage() { - return ( -Loading consent request...
} - ``` - - -Unable to load consent request.
} - function CustomConsentForm() { - const clerk = useClerk() - const location = useLocation() - const searchParams = new URLSearchParams(location.searchStr) - - const clientId = searchParams.get('client_id') ?? '' - const redirectUri = searchParams.get('redirect_uri') ?? '' - const scope = searchParams.get('scope') ?? undefined - const redirectHostname = getRedirectHostname(redirectUri) - - const { data, isLoading, error } = useOAuthConsent({ - oauthClientId: clientId, - scope, - }) - - if (!clientId || !redirectUri) { - returnMissing OAuth consent parameters.
- } - - if (isLoading) { - returnLoading consent request...
- } - - if (error || !data) { - returnUnable to load consent request.
- } - - return ( - + ) + } + + export default function OAuthConsentPage() { + return ( +{redirectUri}
- Missing OAuth consent parameters.
} - function OAuthConsentPage() { - return ( -Loading consent request...
+ } + + if (error || !data) { + returnUnable to load consent request.
} - ``` - - + + return ( + + ) + } + + function OAuthConsentPage() { + return ( +
Client ID: {data.clientId}
+ Signed-in user:{' '} + {user?.primaryEmailAddress?.emailAddress ?? user?.username ?? user?.id} +
+Resource service: Clerk user data
Review the requested permissions before continuing. After you allow or deny access, you will
@@ -114,7 +120,7 @@
Client ID:
+ Signed-in user:{' '}
+ {user?.primaryEmailAddress?.emailAddress ?? user?.username ?? user?.id}
+ Resource service: Clerk user data
Review the requested permissions before continuing. After you allow or deny access, you will
@@ -225,7 +237,7 @@
Client ID:
+ Signed-in user:{' '}
+ {user?.primaryEmailAddress?.emailAddress ?? user?.username ?? user?.id}
+ Resource service: Clerk user data
Review the requested permissions before continuing. After you allow or deny access, you will
@@ -331,8 +349,8 @@
Client ID:
+ Signed-in user:{' '}
+ {user?.primaryEmailAddress?.emailAddress ?? user?.username ?? user?.id}
+ Resource service: Clerk user data
Review the requested permissions before continuing. After you allow or deny access, you will
diff --git a/docs/_partials/components/oauth-consent-examples.mdx b/docs/_partials/components/oauth-consent-examples.mdx
index b0d0603469..2c2ab84132 100644
--- a/docs/_partials/components/oauth-consent-examples.mdx
+++ b/docs/_partials/components/oauth-consent-examples.mdx
@@ -58,7 +58,7 @@
{data.clientId}
{data.clientId}
{data.clientId}