Point compliance portal frontend at portal OAuth API
Update Relay schema paths and HTTP endpoints so the portal app talks to the compliance portal GraphQL and OAuth routes. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
schema: '../../pkg/server/api/trust/v1/schema.graphql'
|
schema: '../../pkg/server/api/complianceportal/v1/schema.graphql'
|
||||||
extensions:
|
extensions:
|
||||||
endpoints:
|
endpoints:
|
||||||
CompliancePage:
|
CompliancePage:
|
||||||
url: http://localhost:8080/api/trust/v1/graphql
|
url: http://localhost:8080/graphql
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import { graphql, useFragment } from "react-relay";
|
|||||||
import { Link as RouterLink, useLocation } from "react-router";
|
import { Link as RouterLink, useLocation } from "react-router";
|
||||||
|
|
||||||
import { buildRequestAllContinueUrl } from "#/lib/auth/continueUrl";
|
import { buildRequestAllContinueUrl } from "#/lib/auth/continueUrl";
|
||||||
import { useSignInDialog } from "#/lib/auth/signInDialogContext";
|
|
||||||
|
|
||||||
import type { TopBar_query$key } from "./__generated__/TopBar_query.graphql";
|
import type { TopBar_query$key } from "./__generated__/TopBar_query.graphql";
|
||||||
import { TOP_BAR_NAV_ITEMS } from "./navItems";
|
import { TOP_BAR_NAV_ITEMS } from "./navItems";
|
||||||
@@ -61,8 +60,6 @@ export function TopBar({ queryKey }: TopBarProps) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const data = useFragment(topBarFragment, queryKey);
|
const data = useFragment(topBarFragment, queryKey);
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const { openSignIn } = useSignInDialog();
|
|
||||||
|
|
||||||
const { currentTrustCenter } = data;
|
const { currentTrustCenter } = data;
|
||||||
const title = currentTrustCenter.title;
|
const title = currentTrustCenter.title;
|
||||||
const logoUrl = currentTrustCenter.themedLogoUrl ?? undefined;
|
const logoUrl = currentTrustCenter.themedLogoUrl ?? undefined;
|
||||||
@@ -112,7 +109,17 @@ export function TopBar({ queryKey }: TopBarProps) {
|
|||||||
color="neutral"
|
color="neutral"
|
||||||
highContrast
|
highContrast
|
||||||
iconStart={<LockSimpleIcon />}
|
iconStart={<LockSimpleIcon />}
|
||||||
onClick={() => openSignIn({ continueTo: buildRequestAllContinueUrl() })}
|
onClick={() => {
|
||||||
|
const initiateURL = new URL(
|
||||||
|
"/initiate",
|
||||||
|
window.location.origin,
|
||||||
|
);
|
||||||
|
initiateURL.searchParams.set(
|
||||||
|
"continue",
|
||||||
|
buildRequestAllContinueUrl(),
|
||||||
|
);
|
||||||
|
window.location.href = initiateURL.toString();
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{t("topBar.getAccess")}
|
{t("topBar.getAccess")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
import { getPathPrefix } from "#/lib/http/pathPrefix";
|
|
||||||
|
|
||||||
export function buildEndpoint(): string {
|
export function buildEndpoint(): string {
|
||||||
let host = import.meta.env.VITE_API_URL;
|
let host = import.meta.env.VITE_API_URL;
|
||||||
|
|
||||||
@@ -34,15 +32,7 @@ export function buildEndpoint(): string {
|
|||||||
|
|
||||||
const url = new URL(formattedHost);
|
const url = new URL(formattedHost);
|
||||||
|
|
||||||
const prefix = getPathPrefix();
|
url.pathname = "/graphql";
|
||||||
let path: string;
|
|
||||||
if (prefix) {
|
|
||||||
path = `${prefix}/api/trust/v1/graphql`;
|
|
||||||
} else {
|
|
||||||
path = `/api/trust/v1/graphql`;
|
|
||||||
}
|
|
||||||
|
|
||||||
url.pathname = path;
|
|
||||||
|
|
||||||
return url.toString();
|
return url.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"trust": {
|
"trust": {
|
||||||
"schema": "pkg/server/api/trust/v1/schema.graphql",
|
"schema": "pkg/server/api/complianceportal/v1/schema.graphql",
|
||||||
"language": "typescript",
|
"language": "typescript",
|
||||||
"noFutureProofEnums": true,
|
"noFutureProofEnums": true,
|
||||||
"customScalarTypes": {
|
"customScalarTypes": {
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"complianceportal": {
|
"complianceportal": {
|
||||||
"schema": "pkg/server/api/trust/v1/schema.graphql",
|
"schema": "pkg/server/api/complianceportal/v1/schema.graphql",
|
||||||
"language": "typescript",
|
"language": "typescript",
|
||||||
"noFutureProofEnums": true,
|
"noFutureProofEnums": true,
|
||||||
"customScalarTypes": {
|
"customScalarTypes": {
|
||||||
|
|||||||
Reference in New Issue
Block a user