File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
internal/sms-gateway/handlers/middlewares/userauth Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func NewBasic(authSvc *auth.Service) fiber.Handler {
5050 return fiber .ErrUnauthorized
5151 }
5252
53- c . Locals ( localsUser , user )
53+ SetUser ( c , user )
5454
5555 return c .Next ()
5656 }
@@ -77,12 +77,16 @@ func NewCode(authSvc *auth.Service) fiber.Handler {
7777 return fiber .ErrUnauthorized
7878 }
7979
80- c . Locals ( localsUser , user )
80+ SetUser ( c , user )
8181
8282 return c .Next ()
8383 }
8484}
8585
86+ func SetUser (c * fiber.Ctx , user * models.User ) {
87+ c .Locals (localsUser , user )
88+ }
89+
8690// HasUser checks if a user is present in the Locals of the given context.
8791// It returns true if the Locals contain a user under the key LocalsUser,
8892// otherwise returns false.
You can’t perform that action at this time.
0 commit comments