✨ Check permissions GRPC method
This commit is contained in:
@ -42,12 +42,12 @@ func authFunc(c *fiber.Ctx, overrides ...string) error {
|
||||
}
|
||||
|
||||
rtk := c.Cookies(services.CookieRefreshKey)
|
||||
if user, perms, atk, rtk, err := services.Authenticate(token, rtk, 0); err == nil {
|
||||
if ctx, perms, atk, rtk, err := services.Authenticate(token, rtk, 0); err == nil {
|
||||
if atk != token {
|
||||
services.SetJwtCookieSet(c, atk, rtk)
|
||||
}
|
||||
c.Locals("permissions", perms)
|
||||
c.Locals("principal", user)
|
||||
c.Locals("principal", ctx.Account)
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user