mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-12 21:58:58 -04:00
fix(graph): use authResponse token exclusively
This commit is contained in:
1 parent
99b01b0734
commit
bb8e185fbd
1 file changed
+9
-1
@@ -1,6 +1,7 @@
|
||||
package svc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
@@ -149,9 +150,16 @@ func (g Graph) SendActivityNotification(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
recipientStat, err := gatewayClient.Stat(
|
||||
metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, authResponse.GetToken()),
|
||||
func() context.Context {
|
||||
md, _ := metadata.FromOutgoingContext(ctx)
|
||||
md = md.Copy()
|
||||
md.Set(revactx.TokenHeader, authResponse.GetToken())
|
||||
|
||||
return metadata.NewOutgoingContext(ctx, md)
|
||||
}(),
|
||||
&storageprovider.StatRequest{Ref: ref},
|
||||
)
|
||||
|
||||
switch {
|
||||
case err != nil:
|
||||
g.logger.Error().Err(err).Msg("could not stat the item as the recipient")
|
||||
|
||||
Reference in new issue
Block a user