To pass token to plugin from browser, follow the steps given below:
- Use the Figma plugin to make a random code.
- Open a OAuth link in the plugin with the code included.
- On your server, check the response from OAuth and save the outcome.
- Request the server for the OAuth callback result directly from the Figma plugin. Use the code generated in step 1 for polling.
- Verify the code against the server records, using it as a key in the cache, to retrieve the corresponding result.