Skip to content

Commit c20679f

Browse files
author
Sachin Maheshwari
committed
fixing decode token issue
1 parent 758fc41 commit c20679f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import React from 'react'
55
import PropTypes from 'prop-types'
66
import { Redirect, Route, Switch, withRouter } from 'react-router-dom'
7-
import jwtDecode from 'jwt-decode'
7+
import { decodeToken } from 'tc-auth-lib'
88
import _ from 'lodash'
99
import renderApp from './components/App'
1010
import TopBarContainer from './containers/TopbarContainer'
@@ -78,7 +78,7 @@ class Routes extends React.Component {
7878
return null
7979
}
8080

81-
let isAllowed = checkAllowedRoles(_.get(jwtDecode(this.props.token), 'roles'))
81+
let isAllowed = checkAllowedRoles(_.get(decodeToken(this.props.token), 'roles'))
8282

8383
if (!isAllowed) {
8484
let warnMessage = 'You are not authorized to use this application'

0 commit comments

Comments
 (0)