Add comments under posts and fix user profile

This commit is contained in:
Marco Realacci 2022-12-12 18:06:56 +01:00
parent 4c4481393d
commit e86526761c
13 changed files with 201 additions and 42 deletions

View file

@ -0,0 +1,4 @@
export default function getCurrentSession() {
if (localStorage.getItem('token') == null) return sessionStorage.getItem('token');
return localStorage.getItem('token');
}

View file

@ -1,4 +1,5 @@
import axios from "axios";
import getCurrentSession from "./authentication";
const instance = axios.create({
baseURL: __API_URL__,
@ -13,7 +14,7 @@ const instance = axios.create({
//});
const updateToken = () => {
instance.defaults.headers.common['Authorization'] = 'Bearer ' + sessionStorage.getItem('token');
instance.defaults.headers.common['Authorization'] = 'Bearer ' + getCurrentSession();
}
export {