File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -56,13 +56,19 @@ func New() fiber.Handler {
5656 oidc_sub = c .Locals ("oidc_sub" ).(string )
5757 }
5858
59+ username := ""
60+ if c .Locals ("username" ) != nil {
61+ username = c .Locals ("username" ).(string )
62+ }
63+
5964 logger .Sugar ().WithOptions (
6065 zap .WithCaller (false ),
6166 ).Infow (
6267 "render engine request" ,
6368 "lmn_level" , "request" ,
6469 "log_id" , c .Locals ("log_id" ).(string ),
6570 "user_id" , user_id ,
71+ "username" , username ,
6672 "oidc_sub" , oidc_sub ,
6773 "route" , c .Path (),
6874 "ip_address" , c .IPs (),
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ func jwtValidation(c *fiber.Ctx, code string) error {
9191
9292 if claims , ok := token .Claims .(jwt.MapClaims ); ok && token .Valid {
9393 c .Locals ("user_id" , claims ["sub" ])
94+ c .Locals ("username" , claims ["username" ])
9495 c .Locals ("oidc_sub" , claims ["oidc_sub" ])
9596 c .Locals ("token" , code )
9697 return c .Next ()
You can’t perform that action at this time.
0 commit comments