We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 758fc41 commit c20679fCopy full SHA for c20679f
src/routes.js
@@ -4,7 +4,7 @@
4
import React from 'react'
5
import PropTypes from 'prop-types'
6
import { Redirect, Route, Switch, withRouter } from 'react-router-dom'
7
-import jwtDecode from 'jwt-decode'
+import { decodeToken } from 'tc-auth-lib'
8
import _ from 'lodash'
9
import renderApp from './components/App'
10
import TopBarContainer from './containers/TopbarContainer'
@@ -78,7 +78,7 @@ class Routes extends React.Component {
78
return null
79
}
80
81
- let isAllowed = checkAllowedRoles(_.get(jwtDecode(this.props.token), 'roles'))
+ let isAllowed = checkAllowedRoles(_.get(decodeToken(this.props.token), 'roles'))
82
83
if (!isAllowed) {
84
let warnMessage = 'You are not authorized to use this application'
0 commit comments