We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e09eaa commit 5225e6dCopy full SHA for 5225e6d
server/internal/middleware/session.go
@@ -2,6 +2,7 @@ package middleware
2
3
import (
4
"net/http"
5
+ "strings"
6
7
"github.com/speakeasy-api/gram/server/internal/contextvalues"
8
)
@@ -13,6 +14,16 @@ func SessionMiddleware(next http.Handler) http.Handler {
13
14
ctx := contextvalues.SetSessionTokenInContext(r.Context(), cookie.Value)
15
r = r.WithContext(ctx)
16
}
17
+ if strings.HasSuffix(r.URL.Path, "rpc/auth.info") {
18
+ http.SetCookie(w, &http.Cookie{
19
+ Name: "gram_session",
20
+ Value: "",
21
+ MaxAge: -1,
22
+ Path: "/rpc",
23
+ HttpOnly: true,
24
+ Secure: true,
25
+ })
26
+ }
27
next.ServeHTTP(w, r)
28
})
29
0 commit comments