Skip to content

Commit

Permalink
Merge pull request stakwork#2025 from MahtabBukhari/Webhook_Auth_Check
Browse files Browse the repository at this point in the history
[BUG] Webhook Auth Check
  • Loading branch information
humansinstitute authored Dec 2, 2024
2 parents b0f8c2b + da80cba commit 195840c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions handlers/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,6 @@ func (th *ticketHandler) PostTicketDataToStakwork(w http.ResponseWriter, r *http
}

func (th *ticketHandler) ProcessTicketReview(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
pubKeyFromAuth, _ := ctx.Value(auth.ContextKey).(string)

if pubKeyFromAuth == "" {
fmt.Println("[ticket] no pubkey from auth")
w.WriteHeader(http.StatusUnauthorized)
json.NewEncoder(w).Encode(map[string]string{"error": "Unauthorized"})
return
}

body, err := io.ReadAll(r.Body)
if err != nil {
Expand Down

0 comments on commit 195840c

Please sign in to comment.