Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/pages/getting-started/providers/notion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@ app.use(

- You need to select "Public Integration" on the configuration page to get an `oauth_id` and `oauth_secret`. Private integrations do not provide these details.
- You must provide a `clientId` and `clientSecret` to use this provider, as-well as a redirect URI (due to this being required by Notion endpoint to fetch tokens).
- The Notion OAuth API doesn’t support refreshing tokens, and so doesn’t return a refresh token. The access token never expires.
7 changes: 7 additions & 0 deletions packages/core/src/providers/notion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ export default function NotionProvider<P extends NotionProfile>(
type: "oauth",
token: {
url: `${NOTION_HOST}/v1/oauth/token`,
async conform(response) {
const body = await response.json()
if (body?.refresh_token === null) {
delete body.refresh_token
}
return new Response(JSON.stringify(body), response)
},
},
userinfo: {
url: `${NOTION_HOST}/v1/users`,
Expand Down