You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a custom Guice provider that registers some factories and the LoginHandler stereotype handler.
However, I noticed the handle(Class<?> resource) method is invoked more than once. Specifically, VRaptor invokes it for each resource (read @component) it finds.
The problem arises when the class that contains the @Login annotation is not the first to be passed to the LoginHandler. In this case, a VraptorAuthenticationException is thrown.
From what I understand, VRaptor invokes (just an example) instance_of_LoginHandler.handle(first_component), which then loops thru the component's methods looking for the @Login annotation.
After the loop ends, it invokes ifThereIsNotAnyLoginActionThrowAnException(), which will throw an exception if first_component doesn't contain a method annotated with @Login.
I just commented out the ifThereIsNotAnyLoginActionThrowAnException invocation for now, but I'm still thinking how we can verify whether the annotation was found or not, while avoiding this issue.
The text was updated successfully, but these errors were encountered:
Hi Rodrigo,
I wrote a custom Guice provider that registers some factories and the
LoginHandler
stereotype handler.However, I noticed the
handle(Class<?> resource)
method is invoked more than once. Specifically, VRaptor invokes it for each resource (read @component) it finds.The problem arises when the class that contains the
@Login
annotation is not the first to be passed to theLoginHandler
. In this case, aVraptorAuthenticationException
is thrown.From what I understand, VRaptor invokes (just an example)
instance_of_LoginHandler.handle(first_component)
, which then loops thru the component's methods looking for the@Login
annotation.After the loop ends, it invokes
ifThereIsNotAnyLoginActionThrowAnException()
, which will throw an exception iffirst_component
doesn't contain a method annotated with@Login
.I just commented out the
ifThereIsNotAnyLoginActionThrowAnException
invocation for now, but I'm still thinking how we can verify whether the annotation was found or not, while avoiding this issue.The text was updated successfully, but these errors were encountered: