Merge pull request #10250 from strapi/fix/sso

Fix SSO success redirection
This commit is contained in:
ELABBASSI Hicham 2021-05-06 11:42:22 +02:00 committed by GitHub
commit 311d8e10e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,8 @@ const AuthResponse = () => {
try {
const jwtToken = Cookies.get('jwtToken');
auth.clearAppStorage();
if (jwtToken) {
auth.setToken(jwtToken, true);
const requestUrl = getRequestUrl('users/me');
@ -49,7 +51,7 @@ const AuthResponse = () => {
redirectToOops();
}
if (authResponse === 'success' && !auth.getToken()) {
if (authResponse === 'success') {
fetchUserInfo();
}
}, [authResponse, fetchUserInfo, redirectToOops]);