Skip to content

Commit

Permalink
fixed login-redirect build
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Jul 15, 2024
1 parent 99ad415 commit 183eb23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/login-redirect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/login-redirect/src/login-redirect.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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'
);

Expand All @@ -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);
Expand Down

0 comments on commit 183eb23

Please sign in to comment.