From 6fb820d6af43128608e5c1d8f9a1e933dde6695e Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sat, 19 Sep 2026 18:00:17 +0200 Subject: [PATCH] feat: store UID in session --- handlers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/handlers.go b/handlers.go index 2033f07..ba5b269 100644 --- a/handlers.go +++ b/handlers.go @@ -112,6 +112,7 @@ func callbackHandler(c *gin.Context) { session.Delete("redirect") session.Set("jhid_auth", true) + session.Set("jhid_uid", claims.Uid) session.Save() if redir != nil { @@ -125,6 +126,8 @@ func EnsureLogin(redirectFail bool) func(c *gin.Context) { return (func(c *gin.Context) { session := sessions.Default(c) if session.Get("jhid_auth") == true { + // Set the UID on the context + c.Set("uid", session.Get("jhid_uid").(string)) c.Next() } else { if redirectFail {