mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-06 20:59:36 +02:00
Add comments under posts and fix user profile
This commit is contained in:
parent
4c4481393d
commit
e86526761c
13 changed files with 201 additions and 42 deletions
4
webui/src/services/authentication.js
Normal file
4
webui/src/services/authentication.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
export default function getCurrentSession() {
|
||||
if (localStorage.getItem('token') == null) return sessionStorage.getItem('token');
|
||||
return localStorage.getItem('token');
|
||||
}
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue