From 183eb23cc7f5e447a7d297b9486aa46b2c39ca8a Mon Sep 17 00:00:00 2001 From: Samuel Imolorhe Date: Mon, 15 Jul 2024 10:28:20 +0200 Subject: [PATCH] fixed login-redirect build --- packages/login-redirect/package.json | 2 +- packages/login-redirect/src/login-redirect.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/login-redirect/package.json b/packages/login-redirect/package.json index 73d5d1dbd3..68a6ade474 100644 --- a/packages/login-redirect/package.json +++ b/packages/login-redirect/package.json @@ -14,7 +14,7 @@ "main": "index.js", "private": true, "scripts": { - "build": "rimraf dist && vite build", + "build": "rimraf dist && tsc && vite build", "dev": "vite --port 1234", "prepare": "yarn build" }, diff --git a/packages/login-redirect/src/login-redirect.ts b/packages/login-redirect/src/login-redirect.ts index ed0d1cb28f..60f2c7f6c3 100644 --- a/packages/login-redirect/src/login-redirect.ts +++ b/packages/login-redirect/src/login-redirect.ts @@ -1,6 +1,6 @@ -import { initializeClient } from '@altairgraphql/api-utils'; import { OAUTH_POPUP_CALLBACK_MESSAGE_TYPE } from '@altairgraphql/api-utils/build/constants'; import { closeWindow, getValidSource, isValidOpener } from './helpers'; +import { getAltairConfig } from 'altair-graphql-core/build/config'; const OAUTH_NONCE_KEY = 'altairgql:oauth:nonce:key'; @@ -73,7 +73,7 @@ const signInWithRedirect = (apiBaseUrl: string) => { }; export const initLoginRedirect = async () => { - const client = initializeClient( + const urlConfig = getAltairConfig().getUrlConfig( import.meta.env.DEV ? 'development' : 'production' ); @@ -86,7 +86,7 @@ export const initLoginRedirect = async () => { sessionStorage.setItem(OAUTH_NONCE_KEY, nonce); - return signInWithRedirect(client.options.apiBaseUrl); + return signInWithRedirect(urlConfig.api); } await sendToken(result.accessToken);