Skip to content

Commit 8371ae2

Browse files
committed
Add User-Agent header to OAuth login requests
1 parent 2b94682 commit 8371ae2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

images/dashboard/src/routes/login_routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ async def redirect_sandbox(request: Request, code: str, state: str = None, db: S
111111
try:
112112
# Get user data
113113
oauth = OAuth2Session(client_id=client_id, redirect_uri=redirect_uri, scope=osm_instance_scopes)
114+
oauth.headers["User-Agent"] = "OSM US Sandbox Dashboard (https://github.com/osm-sandbox/osm-sandbox-dashboard)"
114115
oauth.register_compliance_hook("access_token_response", lambda r: (logging.info(f"Token endpoint response: {r.status_code} {r.text}"), r)[1])
115116
oauth.fetch_token(
116117
f"{osm_instance_url}/oauth2/token", code=code, client_secret=client_secret

0 commit comments

Comments
 (0)