Browse Source

Merge pull request #4204 from rackerlabs/fix-device-code-response

fix: device code pending HTTP response
pull/4234/head
Márk Sági-Kazár 8 months ago committed by GitHub
parent
commit
55a687ba81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      server/deviceflowhandlers.go
  2. 2
      server/deviceflowhandlers_test.go

2
server/deviceflowhandlers.go

@ -255,7 +255,7 @@ func (s *Server) handleDeviceToken(w http.ResponseWriter, r *http.Request) {
if slowDown {
s.tokenErrHelper(w, deviceTokenSlowDown, "", http.StatusBadRequest)
} else {
s.tokenErrHelper(w, deviceTokenPending, "", http.StatusUnauthorized)
s.tokenErrHelper(w, deviceTokenPending, "", http.StatusBadRequest)
}
case deviceTokenComplete:
codeChallengeFromStorage := deviceToken.PKCE.CodeChallenge

2
server/deviceflowhandlers_test.go

@ -467,7 +467,7 @@ func TestDeviceTokenResponse(t *testing.T) {
},
testDeviceCode: "f00bar",
expectedServerResponse: deviceTokenPending,
expectedResponseCode: http.StatusUnauthorized,
expectedResponseCode: http.StatusBadRequest,
},
{
testName: "Invalid Grant Type",

Loading…
Cancel
Save