Open olvap opened 4 years ago
I imagine you have a request
object in all cases? So the solution would be to unify whatever differences you have by inspecting the request and retrieve the user information in different ways depending on the request parameters/hostname/session/path, etc.
hey @rolftimmermans, thanks for your response,
so you mean something like this?
def enabled?(feature)
current_user.enabled_features[feature]
end
def current_user
if(request_has_session?)
request.get_current_user_by_session_id
elsif(request_has_a_token)
request.get_current_user_by_token
end
end
Yes, pretty much that. Does that help?
Hello, I see in the documentation for custom strategies that can only check features if we have the user's session. The problem with that is that the current user is not always obtain the same way in different parts of a application (API token, sso, session) and I would like to have an option to pass the current_user object directly like:
How could do it do something like this possible?