Skip to content

Commit 791e940

Browse files
committed
fix: ensure user authentication before data fetching in AppComponent
1 parent 9df3682 commit 791e940

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/components/Main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ function requireAuth(navigate, auth) {
2828
class AppComponent extends React.Component {
2929
componentDidMount() {
3030
let { navigate, auth } = this.props;
31-
requireAuth(navigate, auth);
31+
32+
// Only proceed with data fetching if user is authenticated
33+
if (!hasAuth(auth)) {
34+
requireAuth(navigate, auth);
35+
return;
36+
}
37+
3238
const services = constants.SERVICE_GROUPS[this.props.serviceGroup].services;
3339
this.props.setResourceFetchStart('service');
3440
this.props.fetchResource(

0 commit comments

Comments
 (0)