Skip to content

Commit a7197d0

Browse files
authored
PluginProxy: Fix nil pointer in OAuth forwarding (#103626)
1 parent ec2cd53 commit a7197d0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/api/pluginproxy/ds_proxy.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
glog "github.com/grafana/grafana/pkg/infra/log"
2020
"github.com/grafana/grafana/pkg/infra/tracing"
2121
"github.com/grafana/grafana/pkg/plugins"
22-
"github.com/grafana/grafana/pkg/services/contexthandler"
2322
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
2423
"github.com/grafana/grafana/pkg/services/datasources"
2524
"github.com/grafana/grafana/pkg/services/featuremgmt"
@@ -263,8 +262,7 @@ func (proxy *DataSourceProxy) director(req *http.Request) {
263262
}
264263

265264
if proxy.oAuthTokenService.IsOAuthPassThruEnabled(proxy.ds) {
266-
reqCtx := contexthandler.FromContext(req.Context())
267-
if token := proxy.oAuthTokenService.GetCurrentOAuthToken(req.Context(), proxy.ctx.SignedInUser, reqCtx.UserToken); token != nil {
265+
if token := proxy.oAuthTokenService.GetCurrentOAuthToken(req.Context(), proxy.ctx.SignedInUser, proxy.ctx.UserToken); token != nil {
268266
req.Header.Set("Authorization", fmt.Sprintf("%s %s", token.Type(), token.AccessToken))
269267

270268
idToken, ok := token.Extra("id_token").(string)

0 commit comments

Comments
 (0)