Skip to content

Commit c503d95

Browse files
committed
Use updated scopes for new oauth provider
1 parent cb81b61 commit c503d95

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

critiquebrainz/frontend/views/oauth.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ def authorize_prompt():
3535
code = oauth.generate_grant(client_id, current_user.id, redirect_uri, scope)
3636
return redirect(build_url(redirect_uri, dict(code=code, state=state)))
3737
except OAuthError as e:
38-
raise BadRequest(e.desc)
38+
raise BadRequest(e.desc)

critiquebrainz/ws/oauth/provider.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def get_authorized_user(self, scopes):
212212
raise exceptions.InvalidToken
213213

214214
token_scopes = token["scope"]
215-
for scope in scopes:
215+
new_scopes = [f"critiquebrainz:{s}" for s in scopes]
216+
for scope in new_scopes:
216217
if scope not in token_scopes:
217218
raise exceptions.InvalidToken
218219

docker/docker-compose.dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ services:
5757
dockerfile: Dockerfile.webpack
5858
command: npm run dev
5959
volumes:
60-
- ..:/code:z
60+
- ../critiquebrainz:/code/critiquebrainz:z

0 commit comments

Comments
 (0)