albatroz
04/20/2024, 8:15 PMroles.go:94: [Info] Role added to user: &{false} with user_id:702116bc-1a9f-4a1c-b71e-3d74d9c0fce4 role: admin
but i can't call endpoint with role claim validator
it eventually works, but i am not sure about the exact time
calling this returns role as admin
go
admin.Get("/auth/role", func(c *fiber.Ctx) error {
sessionContainer := session.GetSessionFromRequestContext(c.UserContext())
response, err := userroles.GetRolesForUser("public", sessionContainer.GetUserID(), nil)
if err != nil {
log.Errorf("Error getting roles: %v", err)
return util.ReturnError(c, 500, "Error getting roles")
}
return util.ReturnSuccess(c, response.OK.Roles)
})
rp_st
04/21/2024, 6:23 AMrp_st
04/21/2024, 6:24 AMrp_st
04/21/2024, 6:24 AM