From 71f649b3c98780f3e0d465ff7faa9fdd6a44a787 Mon Sep 17 00:00:00 2001 From: Steven Hartland Date: Mon, 6 Oct 2025 23:51:34 +0100 Subject: [PATCH] fix: oauth device flow scopes Correct the name of POST variable sent during OAuth device flow as documented in the GitHub API docs. This allows custom scopes to be requested, which were previously ignored. https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github --- githubkit/auth/oauth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/githubkit/auth/oauth.py b/githubkit/auth/oauth.py index 68bcfba71..de24a41fe 100644 --- a/githubkit/auth/oauth.py +++ b/githubkit/auth/oauth.py @@ -36,7 +36,7 @@ def create_device_code( url = base_url.copy_with(raw_path=base_url.raw_path + b"login/device/code") body = {"client_id": client_id} if scopes: - body["scopes"] = " ".join(scopes) + body["scope"] = " ".join(scopes) response = yield httpx.Request( "POST", url,