<@498057949541826571> Why does it take time to va...
# support-questions-legacy
a
@rp_st Why does it take time to validate role claim? I signed up a user, added a role got this log
Copy code
roles.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
Copy code
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)
    })
r
Hey @albatroz
This happens cause by default, the ropes validator syncs from the db every 5 mins.
You can change the time to be instant by passing 0 as the time value in the validator. However, that will ofc make the verification in that api slower each time cause it’s checking the db each time