diff --git a/src/lib/api/api.model.ts b/src/lib/api/api.model.ts index f5e77c1..0e8dcb5 100644 --- a/src/lib/api/api.model.ts +++ b/src/lib/api/api.model.ts @@ -218,6 +218,7 @@ export interface OAuth2ConsentInfo { apiTokensWithInsufficientPermissions: ReadonlyArray; previouslyConsentedGw2AccountIds: ReadonlyArray; containsAnyGw2AccountRelatedScopes: boolean; + redirectUri: string; } export interface MinimalApiToken { diff --git a/src/pages/oauth2-consent.tsx b/src/pages/oauth2-consent.tsx index 45289dd..a46f404 100644 --- a/src/pages/oauth2-consent.tsx +++ b/src/pages/oauth2-consent.tsx @@ -9,7 +9,7 @@ import { Header, Multiselect, MultiselectProps, SpaceBetween, - Spinner, + Spinner, TextContent, } from '@cloudscape-design/components'; import React, { useCallback, useEffect, useMemo, useState, @@ -137,6 +137,13 @@ function ConsentForm({ consentInfo, setActiveWindow }: { consentInfo: OAuth2Cons ]; }, [selectedOptions]); + const redirectBase = useMemo(() => { + const url = new URL(consentInfo.redirectUri); + url.search = ''; + url.pathname = ''; + return url.toString(); + }, [consentInfo]); + return ( <> Authorize {consentInfo.clientRegistration.displayName}} variant={'stacked'}> @@ -181,6 +188,13 @@ function ConsentForm({ consentInfo, setActiveWindow }: { consentInfo: OAuth2Cons + + + + You will be redirected to {redirectBase} + + + ); }