|
|
@ -233,7 +233,9 @@ CoreApp.getInitialProps = async (initialProps) => {
|
|
|
|
if (ctx.res) {
|
|
|
|
if (ctx.res) {
|
|
|
|
// Check if app is initialized and redirect if necessary
|
|
|
|
// Check if app is initialized and redirect if necessary
|
|
|
|
const response = await axios.get<PublicSettingsResponse>(
|
|
|
|
const response = await axios.get<PublicSettingsResponse>(
|
|
|
|
`http://localhost:${process.env.PORT || 5055}/api/v1/settings/public`
|
|
|
|
`http://${process.env.HOST || 'localhost'}:${
|
|
|
|
|
|
|
|
process.env.PORT || 5055
|
|
|
|
|
|
|
|
}/api/v1/settings/public`
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
currentSettings = response.data;
|
|
|
|
currentSettings = response.data;
|
|
|
@ -251,7 +253,9 @@ CoreApp.getInitialProps = async (initialProps) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// Attempt to get the user by running a request to the local api
|
|
|
|
// Attempt to get the user by running a request to the local api
|
|
|
|
const response = await axios.get<User>(
|
|
|
|
const response = await axios.get<User>(
|
|
|
|
`http://localhost:${process.env.PORT || 5055}/api/v1/auth/me`,
|
|
|
|
`http://${process.env.HOST || 'localhost'}:${
|
|
|
|
|
|
|
|
process.env.PORT || 5055
|
|
|
|
|
|
|
|
}/api/v1/auth/me`,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
headers:
|
|
|
|
headers:
|
|
|
|
ctx.req && ctx.req.headers.cookie
|
|
|
|
ctx.req && ctx.req.headers.cookie
|
|
|
|