Skip to content

Commit 05704df

Browse files
committed
Update auth params to install at the user level
Notion made an update to their API effective September 21, 2021 that moves to install integrations at the user level instead of the workplace admin level. Also updates the info helper to extract the user information returned as part of the token response.
1 parent ccddb41 commit 05704df

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/omniauth-notion.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ class Notion < OmniAuth::Strategies::OAuth2
2222
},
2323
}
2424

25+
option :authorize_params, {
26+
owner: 'user',
27+
}
28+
2529
# These are called after authentication has succeeded. If
2630
# possible, you should try to set the UID without making
2731
# additional calls (if the user id is returned with the token
@@ -32,8 +36,10 @@ class Notion < OmniAuth::Strategies::OAuth2
3236
# https://developers.notion.com/docs/authorization#exchanging-the-grant-for-an-access-token
3337
info do
3438
{
39+
workspace_id: raw_info['workspace_id'],
3540
workspace_name: raw_info['workspace_name'],
3641
workspace_icon: raw_info['workspace_icon'],
42+
owner: raw_info['owner'],
3743
bot_id: raw_info['bot_id']
3844
}
3945
end

lib/omniauth-notion/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Omniauth
44
module Notion
5-
VERSION = "0.0.2"
5+
VERSION = "0.0.3"
66
end
77
end

0 commit comments

Comments
 (0)