Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Functional Programming
Diskuy-Frontend
Commits
005e915a
Commit
005e915a
authored
Feb 25, 2021
by
Jonathan Chandra
Browse files
edit authHeader
parent
d6c34cec
Changes
1
Show whitespace changes
Inline
Side-by-side
src/helpers/services/auth.service.js
View file @
005e915a
...
...
@@ -20,7 +20,12 @@ export default new AuthService();
export
const
authHeader
=
()
=>
{
const
user
=
JSON
.
parse
(
localStorage
.
getItem
(
'
user
'
));
return
{
Authorization
:
`Bearer
${
user
?.
data
?.
token
}
`
};
if
(
user
.
accessToken
)
{
return
{
Authorization
:
`Bearer
${
user
.
accessToken
}
`
};
}
else
if
(
user
.
data
.
token
)
{
return
{
Authorization
:
`Bearer
${
user
.
data
.
token
}
`
};
}
};
export
const
loggedIn
=
JSON
.
parse
(
localStorage
.
getItem
(
'
user
'
))
&&
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment