Move authServer to fix relative paths issue

This commit is contained in:
Rachel Macfarlane 2020-07-20 09:31:02 -07:00
parent e1dce24837
commit 7725bf1bcc
3 changed files with 4 additions and 3 deletions

View file

@ -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'),

View file

@ -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';

View file

@ -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)