Skip to content

Commit

Permalink
Change background context to request context
Browse files Browse the repository at this point in the history
Signed-off-by: PumpkinSeed <qwer.kocka@gmail.com>
  • Loading branch information
PumpkinSeed committed May 10, 2023
1 parent f39c907 commit e91b39f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/deviceflowhandlers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package server

import (
"context"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -59,7 +58,7 @@ func (s *Server) handleDeviceExchange(w http.ResponseWriter, r *http.Request) {
}

func (s *Server) handleDeviceCode(w http.ResponseWriter, r *http.Request) {
ctx := context.Background()
ctx := r.Context()
pollIntervalSeconds := 5

switch r.Method {
Expand Down Expand Up @@ -282,7 +281,7 @@ func (s *Server) handleDeviceToken(w http.ResponseWriter, r *http.Request) {
}

func (s *Server) handleDeviceCallback(w http.ResponseWriter, r *http.Request) {
ctx := context.Background()
ctx := r.Context()
switch r.Method {
case http.MethodGet:
userCode := r.FormValue("state")
Expand Down

0 comments on commit e91b39f

Please sign in to comment.