chore: remove OAuth from chrome extension (#5528)

Since we can access the tokens directly from cookies of our front app,
we don't require the OAuth process to fetch tokens anymore
This commit is contained in:
Aditya Pimpalkar
2024-05-23 23:01:47 +01:00
committed by GitHub
parent fede721ba8
commit f9a3d5fd15
5 changed files with 194 additions and 205 deletions

View File

@ -1,5 +1,6 @@
import { insertButtonForCompany } from '~/contentScript/extractCompanyProfile';
import { insertButtonForPerson } from '~/contentScript/extractPersonProfile';
import { isDefined } from '~/utils/isDefined';
// Inject buttons into the DOM when SPA is reloaded on the resource url.
// e.g. reload the page when on https://www.linkedin.com/in/mabdullahabaid/
@ -21,3 +22,12 @@ chrome.runtime.onMessage.addListener(async (message, _, sendResponse) => {
sendResponse('Executing!');
});
chrome.storage.local.onChanged.addListener(async (store) => {
if (isDefined(store.accessToken)) {
if (isDefined(store.accessToken.newValue)) {
await insertButtonForCompany();
await insertButtonForPerson();
}
}
});