Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolved login issue #844

Merged
1 change: 0 additions & 1 deletion src/app/LayoutCommon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ if (allEnvKeys.length === 0) {
const exposedEnvKeys = allEnvKeys.filter((key) => !excludeKeys.includes(key));

const initData: Record<string, any> = {};
const excludedEnvData: Record<string, any> = {};

allEnvKeys.forEach((key) => {
const value = process.env[key] || import.meta.env[key];
Expand Down
2 changes: 1 addition & 1 deletion src/config/SocketConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { envConfig } from "./envConfig"
import io from "socket.io-client"

const SOCKET = io(`${import.meta.env.PUBLIC_BASE_URL}`, {
const SOCKET = io(`${envConfig.PUBLIC_BASE_URL}`, {
reconnection: true,
reconnectionDelay: 500,
reconnectionAttempts: Infinity,
Expand Down
2 changes: 1 addition & 1 deletion src/config/ssrApiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const API = async ({ token, url, method, payload }: IProps) => {
method,
body: JSON.stringify(payload),
};
const baseURL = globalThis.baseUrl || import.meta.env.PUBLIC_BASE_URL || process.env.PUBLIC_BASE_URL;
const baseURL = globalThis.baseUrl || envConfig.PUBLIC_BASE_URL || process.env.PUBLIC_BASE_URL;
const apiURL = baseURL + url;
const res = await fetch(apiURL, {
...config,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/user/[user].astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
import LogoFile from '../../commonComponents/LogoFile';
import CustomAvatar from '../../components/Avatar';
import { envConfig } from '../../config/envConfig';
import { pathRoutes } from '../../config/pathRoutes';

const { user } = Astro.params;
const baseUrl = process.env.PUBLIC_BASE_URL || import.meta.env.PUBLIC_BASE_URL
const baseUrl = process.env.PUBLIC_BASE_URL || envConfig.PUBLIC_BASE_URL
const response = await fetch(`${baseUrl}/users/public-profiles/${user}`);
const data = await response.json();
const userData = data?.data;
Expand Down
4 changes: 2 additions & 2 deletions src/services/axiosIntercepter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getFromLocalStorage, setToLocalStorage } from '../api/Auth';
import { apiStatusCodes, storageKeys } from '../config/CommonConstant';

const instance = axios.create({
baseURL: import.meta.env.PUBLIC_BASE_URL,
baseURL: envConfig.PUBLIC_BASE_URL,
});

const EcosystemInstance = axios.create({
Expand All @@ -16,7 +16,7 @@ const EcosystemInstance = axios.create({
const checkAuthentication = async (sessionCookie: string, request: AxiosRequestConfig) => {
const isAuthPage = window.location.href.includes('/authentication/sign-in') || window.location.href.includes('/authentication/sign-up')
try {
const baseURL = import.meta.env.PUBLIC_BASE_URL || process.env.PUBLIC_BASE_URL;
const baseURL = envConfig.PUBLIC_BASE_URL || process.env.PUBLIC_BASE_URL;
const config = {
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/utils/check-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const checkUserSession = async ({

try {
const baseURL =
import.meta.env.PUBLIC_BASE_URL ||
envConfig.PUBLIC_BASE_URL ||
process.env.PUBLIC_BASE_URL;
const config = {
headers: {
Expand Down
Loading