-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logging/ error statement for VS Code Credential for token expiration #18126
Comments
In this case we expect Msal to throw MsalInterationRequiredError/Exception. Maybe check if there are existing tests or add a test if not present |
To test this, you can manually change the received token. You will receive it in one of the functions on async sendGetRequestAsync<T>(/* … */): Promise<NetworkResponse<T>> {
// …
let response = await this.sendRequest(request);
response = changeResponseIfHasToken(response); // This line
return {
// …
};
}
async sendPostRequestAsync<T>(/* … */): Promise<NetworkResponse<T>> {
// …
let response = await this.sendRequest(request);
response = changeResponseIfHasToken(response); // This one
return {
// …
};
}
}
// Something like this…
function changeResponseIfHasToken(response) {
if (response.indexOf("token") > -1) {
const token = JSON.parse(response).token; // it might be called acces_token
const tomorrow = new Date();
tomorrow.setTime(tomorrow.geetTime()+1);
return JSON.stringify({ token, expiresOn: tomorrow })
}
return response;
} We can sync up in case something is off 🙂 ✨team work✨ |
I am positive that the approach above will help us debug the scenario of timeout and evaluate if we get appropriate error message in that scenario. But for now this credential is broken because of this bug. Due to this, when we try to run the application using the credential, we will first run into the issue described in the bug and not be able to test the timeout scenario. We can wait until bug is fixed. |
Thank you, @KarishmaGhiya |
Hi @KarishmaGhiya, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
Reference - #17734 (comment)
The text was updated successfully, but these errors were encountered: