Skip to content

Commit

Permalink
Merge pull request #1567 from gustavomm19/google-auth
Browse files Browse the repository at this point in the history
fix the scopes for simple auth
  • Loading branch information
jefer94 authored Feb 21, 2025
2 parents 4a28564 + 8673f20 commit 8ed5e43
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions breathecode/authenticate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@
CredentialsFacebook,
CredentialsGithub,
CredentialsGoogle,
NotFoundAnonGoogleUser,
CredentialsSlack,
GithubAcademyUser,
GitpodUser,
GoogleWebhook,
NotFoundAnonGoogleUser,
Profile,
ProfileAcademy,
Role,
Expand Down Expand Up @@ -2203,11 +2203,15 @@ def get_google_token(request, token=None):
state = f"token={token.key if token is not None else ""}&url={url}"

scopes = [
"https://www.googleapis.com/auth/meetings.space.created",
"https://www.googleapis.com/auth/drive.meet.readonly",
"https://www.googleapis.com/auth/userinfo.profile",
]

if token is not None:
scopes = scopes + [
"https://www.googleapis.com/auth/meetings.space.created",
"https://www.googleapis.com/auth/drive.meet.readonly",
]

if academy_settings in ["overwrite", "set"]:
if feature.is_enabled("authenticate.set_google_credentials", default=False) is False:
raise ValidationException(
Expand Down Expand Up @@ -2262,6 +2266,8 @@ async def async_iter(iterable: list):

logger.debug("Google callback just landed")
logger.debug(request.query_params)
print("Google callback just landed")
print(request.query_params)

error = request.query_params.get("error", False)
error_description = request.query_params.get("error_description", "")
Expand Down

0 comments on commit 8ed5e43

Please sign in to comment.