supabase / auth

A JWT based API for managing users and issuing JWT tokens
https://supabase.com/docs/guides/auth
MIT License
1.55k stars 375 forks source link

Add duplicated Notion template's ID to the JWT receieved after Supabase's Notion OAuth flow #1049

Open AjayRH opened 2 years ago

AjayRH commented 2 years ago

Feature request

Is your feature request related to a problem? Please describe.

Notion's OAuth workflow now allows integrations to duplicate a public Notion template and automatically share the duplicated template with the integration. The JWT that is returned after successful authorization using Supabase's API currently does not include the ID of the duplicated template. The template ID allows integrations to modify the duplicated template in a user's Notion workspace.

Describe the solution you'd like

The JWT returned after successful authorization should include the duplicated template's ID.

Describe alternatives you've considered

After a user has signed in with Notion, trigger another OAuth flow using Notion's native Authorization URL to collect the duplicated template ID

Additional context

Capture

Notion's native OAuth API returns the template id with a key of duplicated_template_id

Marviel commented 4 months ago

@kangmingtay hi!! Wondering if you could point me in the right direction to implement this.

Need it for my use case.

hatsumatsu commented 1 month ago

This would be a very helpful feature, @kangmingtay.

Some context:

If users log in with Notion and choose the option "use a template provided by the developer" in the login flow, the template is cloned but the newly created page(s) are not immediately available through Notion's /search API endpoint. This means there is no way for the integration to receive the shared page/database immediately after the auth flow.

Indexing the new page can take anything from seconds to minutes, leaving the integration non-functional in the meantime.

Exposing the duplicated_template_id property returned by Notion's /token endpoint would solve this, since querying a page/database by this ID works immediately.