Bastien-and-Gauvain / monorepo

A chrome extension to help recruiters 1-click export LinkedIn profiles in their Notion databases.
https://chromewebstore.google.com/detail/recruitivity/gahcfmlnmednhnbkifdoffblfffpeljf
3 stars 0 forks source link

✨ feat(back) PLAS-056: Store Notion API Tokens #33

Closed bvelitchkine closed 11 months ago

bvelitchkine commented 11 months ago

Context

We used Supabase API to login through a social provider (Notion in our case, obviously). It turns out that whilst logging into Supabase through Notion, Supabase also yields the provider (Notion) token in case we need to interact with the provider's API afterwards.

We do need to interact with Notion's API. So we need to store that API token for later use.

Solution

It's simple enough, thanks to Plasmo's storage utility. We just store the whole payload sent by Supabase upon authentication. Notion's API token is in there somewhere, under the provider_token key.