Commit bcb43f39 authored by Valiantsin's avatar Valiantsin
Browse files

fix: authentication

parent 2f16f465
......@@ -34,16 +34,7 @@ app.use(
const authProxyPort = process.env.AUTH_SERVER_PORT || '8080';
const authProxyHost = process.env.AUTH_SERVER_HOST || 'server';
app.use(
proxy('/api/login', {
target: `http://${authProxyHost}:${authProxyPort}`,
pathRewrite: {
'^/api': '/', // rewrite path
},
})
);
app.use(
proxy('/auth', {
proxy('/login', {
target: `http://${authProxyHost}:${authProxyPort}`,
})
);
......
import { handleErrors } from './handleErrors';
export async function login(): Promise<void> {
// temporary hardcode redirect URL for login
window.open(`http://localhost:8080/login`, '_blank');
// return fetch(`http://localhost:8080/login`)
// .then(handleErrors)
// .then(response => response.json());
export function login(): void {
// eslint-disable-next-line no-restricted-globals
location.replace('/login');
}
......@@ -16,12 +16,4 @@ module.exports = function(app) {
},
})
);
app.use(
proxy('/api/auth', {
target: 'http://localhost:8080',
pathRewrite: {
'^/api': '/', // rewrite path
},
})
);
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment