Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Functional Programming
Diskuy-Frontend
Commits
18b838c7
Commit
18b838c7
authored
Feb 22, 2021
by
FadhilP
Browse files
export isAdmin function to auth.service
parent
49626b4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/helpers/services/auth.service.js
View file @
18b838c7
...
...
@@ -24,3 +24,6 @@ export const authHeader = () => {
};
export
const
loggedIn
=
JSON
.
parse
(
localStorage
.
getItem
(
'
user
'
))
&&
1
;
export
const
isAdmin
=
loggedIn
&&
JSON
.
parse
(
localStorage
.
getItem
(
'
user
'
))?.
data
?.
role
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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