Skip to content

Commit e2745ed

Browse files
author
Vikas Agarwal
committed
fix: one more instance of jet decoding
1 parent c5fbe0f commit e2745ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/tc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import { MARATHON_MATCH_SUBTRACKS, CHALLENGE_TRACKS, ALLOWED_USER_ROLES, ADMIN_ROLES } from '../config/constants'
55
import _ from 'lodash'
6-
import jwtDecode from 'jwt-decode'
6+
import { decodeToken } from 'tc-auth-lib'
77

88
export const RATING_COLORS = [{
99
color: '#9D9FA0' /* Grey */,
@@ -56,6 +56,6 @@ export const checkAllowedRoles = (roles) => roles.some(val => ALLOWED_USER_ROLES
5656
* @param token
5757
*/
5858
export const checkAdmin = (token) => {
59-
const roles = _.get(jwtDecode(token), 'roles')
59+
const roles = _.get(decodeToken(token), 'roles')
6060
return roles.some(val => ADMIN_ROLES.indexOf(val.toLowerCase()) > -1)
6161
}

0 commit comments

Comments
 (0)