Skip to content

Commit 814d187

Browse files
committed
Apply suggestions
1 parent b2d513b commit 814d187

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

backend/apps/slack/models/google_auth.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ class GoogleAuth(models.Model):
3232

3333
@staticmethod
3434
def authenticate(member):
35-
"""Authenticate a member and return a GoogleAuth instance."""
35+
"""Authenticate a member.
36+
37+
Returns:
38+
- GoogleAuth instance if a valid/refreshable token exists, or
39+
- (authorization_url, state) tuple to complete the OAuth flow.
40+
41+
"""
3642
if not settings.IS_GOOGLE_AUTH_ENABLED:
3743
raise ValueError(AUTH_ERROR_MESSAGE)
3844
auth = GoogleAuth.objects.get_or_create(member=member)[0]
@@ -48,7 +54,6 @@ def authenticate(member):
4854
state = member.slack_user_id
4955
return flow.authorization_url(
5056
access_type="offline",
51-
include_granted_scopes="true",
5257
prompt="consent",
5358
state=state,
5459
)

backend/tests/apps/slack/models/google_auth_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def test_authenticate_first_time(self, mock_get_or_create, mock_get_flow):
170170

171171
mock_flow_instance.authorization_url.assert_called_once_with(
172172
access_type="offline",
173-
include_granted_scopes="true",
174173
prompt="consent",
175174
state=self.member.slack_user_id,
176175
)

0 commit comments

Comments
 (0)