Skip to content

Commit

Permalink
fix: delete getCookie usage on httponly cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
rasulov1337 committed Dec 16, 2024
1 parent 9027644 commit ea3d6b4
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const pageContainer = document.createElement('div');

import router from './modules/Router';
import { HorizontalAdCardData } from './components/HorizontalAdCard/HorizontalAdCard';
import { getCookie } from './modules/Utils';
import globalStore from './modules/GlobalStore';
import ChatPage from './pages/ChatPage/ChatPage';
import ChatRepository from './repositories/ChatRepository';
Expand Down Expand Up @@ -144,15 +143,13 @@ const renderHeader = async () => {
document.querySelector('.header')?.remove();

let sessionData;
if (getCookie('session_id')) {
try {
sessionData = await APIService.getSessionData();

globalStore.auth.isAuthorized = true;
globalStore.auth.userId = sessionData.id;
} catch {
//
}
try {
sessionData = await APIService.getSessionData();

globalStore.auth.isAuthorized = true;
globalStore.auth.userId = sessionData.id;
} catch {
//
}

const header = new Header(headerCallbacks, sessionData ? true : false);
Expand Down

0 comments on commit ea3d6b4

Please sign in to comment.