Skip to content

Commit 60598e9

Browse files
committed
Fix an unexpected error during LoginCallback
Simplify LoginCallback by removing unused hooks and redundant logic. Removed error: Warning: Cannot update a component (`StateProvider`) while rendering a different component (`LoginCallback`). To locate the bad setState() call inside `LoginCallback`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render LoginCallback OidcRoutes AuthenticationProvider AuthProvider Router BrowserRouter div Styled(div) Box Component@ SnackProvider ThemeProvider ThemeProvider ThemeProvider AppThemeProvider StateProvider AppStateProvider App
1 parent 01db6aa commit 60598e9

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
import useClusterStatus from '../hooks/ClusterStatus.jsx'
2-
import { useStateValue } from "../state.js"
3-
41
function LoginCallback(props) {
5-
const { close } = useClusterStatus()
6-
const [{ authChoice }, dispatch] = useStateValue()
7-
console.log("login callback")
8-
if (authChoice != "openid") {
9-
dispatch({type: "setAuthChoice", data: "openid"})
10-
}
11-
close()
12-
return null
2+
console.log("auth completed, returning to application")
133
}
144

155
export default LoginCallback

0 commit comments

Comments
 (0)