Commit b887497a authored by Alex Kakiris's avatar Alex Kakiris
Browse files

redirect to login only after the refresh fails in initAuth

parent 0c0fb636
Loading
Loading
Loading
Loading
+0 −2
Changes for capif_frontend/src/context/AuthContext.js: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -75,8 +75,6 @@ const AuthProvider = ({ children }) => {
        } catch (error) { // ON ERROR it retries using refresh token
          try {
            console.log('Entered error catch block')
            console.log('Redirecting to login...')
            router.push('/login')
            const response = await axiosInstance.post(authConfig.refreshEndpoint)
            setAccessToken(response.data.access_token)
            console.log('AuthContext access token: ', response.data.access_token)