Open vanshnayak2002 opened 1 month ago
export const executeBasicAuthenticationService = (token) => apiClient.get(/basicauth,{ headers: { Authorization: token } })
are you even returning the response
else { logout() return false
} } catch(error){ logout() return false }
also in this case your execution is going in else and running logout and then also because it's an error its again going in catch and again running logout which cause the Cannot remove node "366" because no matching node was found in the Store.
and also you cant share a localhost for others to see localhost will only work on your system. to share with others you need to deploy, you can do that on github pages or netlify.
Website or app
http://localhost:3000/welcome
Repro steps
I created token for user authentication and pass into context so that user can reuse that token to call an API
when i logout or login on my localhost i see this error
STEP 1 Create a token export const executeBasicAuthenticationService = (token) => apiClient.get(
/basicauth
,{ headers: { Authorization: token } })STEP-2 Pass into context
async function login(username, password) {
const baToken = 'Basic ' + window.btoa( username + ":" + password )
try{
const response = await executeBasicAuthenticationService(baToken)
if(response.status==200){ setAuthenticated(true) setUsername(username) settoken(baToken) return true
} catch(error){ logout() return false }
}
function logout(){ setAuthenticated(false) settoken(null) setUsername(null) }
<AuthContext.Provider value={ {isAuthenticated,setAuthenticated,login,logout,username,token} }>
</AuthContext.Provider>
}
How often does this bug happen?
Every time
DevTools package (automated)
react-devtools-extensions
DevTools version (automated)
5.3.1-ccb20cb88b
Error message (automated)
Cannot remove node "366" because no matching node was found in the Store.
Error call stack (automated)
Error component stack (automated)
No response
GitHub query string (automated)