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:
|
||||
endpoints:
|
||||
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 { buildRequestAllContinueUrl } from "#/lib/auth/continueUrl";
|
||||
import { useSignInDialog } from "#/lib/auth/signInDialogContext";
|
||||
|
||||
import type { TopBar_query$key } from "./__generated__/TopBar_query.graphql";
|
||||
import { TOP_BAR_NAV_ITEMS } from "./navItems";
|
||||
@@ -61,8 +60,6 @@ export function TopBar({ queryKey }: TopBarProps) {
|
||||
const { t } = useTranslation();
|
||||
const data = useFragment(topBarFragment, queryKey);
|
||||
const { pathname } = useLocation();
|
||||
const { openSignIn } = useSignInDialog();
|
||||
|
||||
const { currentTrustCenter } = data;
|
||||
const title = currentTrustCenter.title;
|
||||
const logoUrl = currentTrustCenter.themedLogoUrl ?? undefined;
|
||||
@@ -112,7 +109,17 @@ export function TopBar({ queryKey }: TopBarProps) {
|
||||
color="neutral"
|
||||
highContrast
|
||||
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")}
|
||||
</Button>
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import { getPathPrefix } from "#/lib/http/pathPrefix";
|
||||
|
||||
export function buildEndpoint(): string {
|
||||
let host = import.meta.env.VITE_API_URL;
|
||||
|
||||
@@ -34,15 +32,7 @@ export function buildEndpoint(): string {
|
||||
|
||||
const url = new URL(formattedHost);
|
||||
|
||||
const prefix = getPathPrefix();
|
||||
let path: string;
|
||||
if (prefix) {
|
||||
path = `${prefix}/api/trust/v1/graphql`;
|
||||
} else {
|
||||
path = `/api/trust/v1/graphql`;
|
||||
}
|
||||
|
||||
url.pathname = path;
|
||||
url.pathname = "/graphql";
|
||||
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
},
|
||||
"trust": {
|
||||
"schema": "pkg/server/api/trust/v1/schema.graphql",
|
||||
"schema": "pkg/server/api/complianceportal/v1/schema.graphql",
|
||||
"language": "typescript",
|
||||
"noFutureProofEnums": true,
|
||||
"customScalarTypes": {
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
},
|
||||
"complianceportal": {
|
||||
"schema": "pkg/server/api/trust/v1/schema.graphql",
|
||||
"schema": "pkg/server/api/complianceportal/v1/schema.graphql",
|
||||
"language": "typescript",
|
||||
"noFutureProofEnums": true,
|
||||
"customScalarTypes": {
|
||||
|
||||
Reference in New Issue
Block a user