fix(graph): use authResponse token exclusively

This commit is contained in:
Florian Schade committed 2026-08-18 15:03:57 +02:00
1 parent 99b01b0734
commit bb8e185fbd
1 file changed
+9 -1
+9 -1
View File
@@ -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")