Skip to content

Commit

Permalink
fix: oauth callback
Browse files Browse the repository at this point in the history
  • Loading branch information
DaKingKong committed Jul 1, 2024
1 parent f065ead commit c131db1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ async function onAuthCallback({ serverUrl, callbackUri }) {
oauthCallbackUrl = `${serverUrl}/oauth-callback?callbackUri=${callbackUri}&hostname=${hostname}`;
}
const res = await axios.get(oauthCallbackUrl);
showNotification({ level: res.data.returnMessage?.messageType ?? 'success', message: res.data.returnMessage?.message ?? 'Successfully authorized.', ttl: res.data.returnMessage?.ttl ?? 3000 });
if (!!!res.data.jwtToken) {
return;
}
const crmUserInfo = { name: res.data.name };
await chrome.storage.local.set({ crmUserInfo });
setAuth(true, crmUserInfo.name);
showNotification({ level: res.data.returnMessage?.messageType ?? 'success', message: res.data.returnMessage?.message ?? 'Successfully authorized.', ttl: res.data.returnMessage?.ttl ?? 3000 });
await chrome.storage.local.set({
['rcUnifiedCrmExtJwt']: res.data.jwtToken
});
Expand Down

0 comments on commit c131db1

Please sign in to comment.