Fakultas Ilmu Komputer UI

Commit ce4c227a authored by FadhilP's avatar FadhilP
Browse files

optimize authHeader.service

parent 79a350d0
export default function authHeader() {
const user = JSON.parse(localStorage.getItem('user'));
if (user && user.tokenId)
return { Authorization: `Bearer ${user.accessToken}` };
else if (user && user.data.token)
if (user?.tokenId)
return { Authorization: `Bearer ${user?.accessToken}` };
else if (user?.data?.token)
// kalo make google
return { Authorization: `Bearer ${user.data.token}` };
return { Authorization: `Bearer ${user?.data.token}` };
// if (user && user.token)
// return { Authorization: `Bearer ${user.token}` }
else return {};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment