Skip to content

Commit 724c172

Browse files
committed
Guard jwtDecode call when auth token is absent
1 parent 217a00a commit 724c172

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/model_catalog/src/ValidationFramework.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,10 @@ class ValidationFramework extends React.Component {
410410
setStatus(response.data.status)
411411
});
412412

413-
const tokenPayload = jwtDecode(this.props.auth.token);
414-
this.setState({currentUser: tokenPayload.preferred_username})
413+
if (this.props.auth.token) {
414+
const tokenPayload = jwtDecode(this.props.auth.token);
415+
this.setState({currentUser: tokenPayload.preferred_username});
416+
}
415417

416418
datastore
417419
.getValidFilterValues()

0 commit comments

Comments
 (0)