Skip to content

Commit

Permalink
Use updated scopes for new oauth provider
Browse files Browse the repository at this point in the history
  • Loading branch information
amCap1712 committed Dec 4, 2024
1 parent cb81b61 commit c503d95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion critiquebrainz/frontend/views/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def authorize_prompt():
code = oauth.generate_grant(client_id, current_user.id, redirect_uri, scope)
return redirect(build_url(redirect_uri, dict(code=code, state=state)))
except OAuthError as e:
raise BadRequest(e.desc)
raise BadRequest(e.desc)
3 changes: 2 additions & 1 deletion critiquebrainz/ws/oauth/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def get_authorized_user(self, scopes):
raise exceptions.InvalidToken

token_scopes = token["scope"]
for scope in scopes:
new_scopes = [f"critiquebrainz:{s}" for s in scopes]
for scope in new_scopes:
if scope not in token_scopes:
raise exceptions.InvalidToken

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ services:
dockerfile: Dockerfile.webpack
command: npm run dev
volumes:
- ..:/code:z
- ../critiquebrainz:/code/critiquebrainz:z

0 comments on commit c503d95

Please sign in to comment.