specific-silverS
Refine2y ago
3 replies
specific-silver

AuthProvider Check Method Query

Dear Refine Team - I am using the Check Method of Auth Provider as below. The catch block catches the error and redirects to login page, however the login page is not showing the error that occured. We want to show the error through notification on Login Page. What needs to be done to address this requirement?

try {
await check(authorization_code);
const state = localStorage.getItem('state');
if (state !== returnedState) {
throw new Error('Invalid state value. Please try again.');
}
urlParams.delete('state');
window.location.search = urlParams.toString();
checkResponse.authenticated = true;
checkResponse.error = undefined;
return Promise.resolve(checkResponse);
} catch (e) {
console.error('Login failed', e);
checkResponse.authenticated = false;
checkResponse.redirectTo = failureRedirectTo;
checkResponse.logout = true;
checkResponse.error = e;
return Promise.resolve(checkResponse);
}
Was this page helpful?