remove JSON.stringify from authorization tokens

This commit is contained in:
Spectralitree 2021-07-18 11:14:28 +02:00
parent 6d7f56fe58
commit cdd8037d5f
6 changed files with 14 additions and 23 deletions

View file

@ -53,7 +53,7 @@ export default function Memberlist() {
fetch(`${API_URL}s/${userId}/members`,{
method: 'GET',
headers: {
'Authorization': JSON.stringify(localStorage.getItem("token")).slice(1, -1)
'Authorization': localStorage.getItem("token")
}}).then ( res => res.json()
).then (data => {
setMembers(data)
@ -169,7 +169,7 @@ export default function Memberlist() {
body: JSON.stringify(newdata),
headers: {
'Content-Type': 'application/json',
'Authorization': JSON.stringify(localStorage.getItem("token")).slice(1, -1)
'Authorization': localStorage.getItem("token")
}}).then (res => res.json()
).then (data => {
setErrorAlert(false);