From 7725bf1bcc0fcc3c96286ab1dcf2c66491eaefdc Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Mon, 20 Jul 2020 09:31:02 -0700 Subject: [PATCH] Move authServer to fix relative paths issue --- .../extension-browser.webpack.config.js | 1 + extensions/microsoft-authentication/src/AADHelper.ts | 2 +- .../microsoft-authentication/src/{env/node => }/authServer.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) rename extensions/microsoft-authentication/src/{env/node => }/authServer.ts (95%) diff --git a/extensions/microsoft-authentication/extension-browser.webpack.config.js b/extensions/microsoft-authentication/extension-browser.webpack.config.js index 5d4b88ed221..d2f4d9ee94b 100644 --- a/extensions/microsoft-authentication/extension-browser.webpack.config.js +++ b/extensions/microsoft-authentication/extension-browser.webpack.config.js @@ -22,6 +22,7 @@ module.exports = withBrowserDefaults({ resolve: { alias: { './env/node': path.resolve(__dirname, 'src/env/browser'), + './authServer': path.resolve(__dirname, 'src/env/browser/authServer'), 'buffer': path.resolve(__dirname, 'node_modules/buffer/index.js'), 'node-fetch': path.resolve(__dirname, 'node_modules/node-fetch/browser.js'), 'randombytes': path.resolve(__dirname, 'node_modules/randombytes/browser.js'), diff --git a/extensions/microsoft-authentication/src/AADHelper.ts b/extensions/microsoft-authentication/src/AADHelper.ts index b553b1a64ca..24599f62b22 100644 --- a/extensions/microsoft-authentication/src/AADHelper.ts +++ b/extensions/microsoft-authentication/src/AADHelper.ts @@ -6,7 +6,7 @@ import * as randomBytes from 'randombytes'; import * as querystring from 'querystring'; import * as vscode from 'vscode'; -import { createServer, startServer } from './env/node/authServer'; +import { createServer, startServer } from './authServer'; import { v4 as uuid } from 'uuid'; import { keychain } from './keychain'; diff --git a/extensions/microsoft-authentication/src/env/node/authServer.ts b/extensions/microsoft-authentication/src/authServer.ts similarity index 95% rename from extensions/microsoft-authentication/src/env/node/authServer.ts rename to extensions/microsoft-authentication/src/authServer.ts index 88e02015fd2..caae72ba52c 100644 --- a/extensions/microsoft-authentication/src/env/node/authServer.ts +++ b/extensions/microsoft-authentication/src/authServer.ts @@ -130,10 +130,10 @@ export function createServer(nonce: string) { } break; case '/': - sendFile(res, path.join(__dirname, '../../../media/auth.html'), 'text/html; charset=utf-8'); + sendFile(res, path.join(__dirname, '../media/auth.html'), 'text/html; charset=utf-8'); break; case '/auth.css': - sendFile(res, path.join(__dirname, '../../../media/auth.css'), 'text/css; charset=utf-8'); + sendFile(res, path.join(__dirname, '../media/auth.css'), 'text/css; charset=utf-8'); break; case '/callback': deferredCode.resolve(callback(nonce, reqUrl)