File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ export interface NotionProfile {
4040 * @see [Notion - Authentication](https://developers.notion.com/reference/authentication)
4141 * @see [Notion - Retrieve your token's bot user](https://developers.notion.com/reference/get-self)
4242 * @todo : It's required to pass the Notion-Version header to access the user info endpoint.
43+ * headers: { Notion-Version: "2022-06-28" }
44+ * @todo : It's required to add Basic headers for access token request.
45+ * headers: { Authorization: "Basic base64(client_id:client_secret)" }
4346 */
4447export const notion : OAuthProviderConfig < NotionProfile > = {
4548 id : "notion" ,
@@ -49,4 +52,12 @@ export const notion: OAuthProviderConfig<NotionProfile> = {
4952 userInfo : "https://api.notion.com/v1/users/me" ,
5053 scope : "user:read" ,
5154 responseType : "code" ,
55+ profile ( profile ) {
56+ return {
57+ sub : profile . id ,
58+ name : profile . name ,
59+ image : profile . avatar_url ?? "" ,
60+ email : profile ?. bot ?. owner ?. user ?. person ?. email ,
61+ }
62+ } ,
5263}
You can’t perform that action at this time.
0 commit comments