Which has been really helpfull to start with, but I'd like now to use AJAX to avoid refresh the page and also the mojit with the form is a child of a HTMLFrameMojit, so what I've tried is stop the submit form through its mojit binder, captured the form values and broadcasted them to the master mojit (the HTML Frame mojit), so but I dont know if I should refresh the whole page now, I guess I may need to refresh it and attach somehow the values to the body so passport can get them? I may overcomplicated this..
Is there any more simple way to use middleware with HTMLFrames..?
I guess what you're looking for here is to invoke an action on the server side for the mojit that contains the form, to do something with those values if the user is logged in, otherwise fail to process and reporting an error. Assuming that's what you need, then you can do this by simply doing what you're doing in the binder of the mojit, picking up the data from the form elements, and eventually using mojitProxy.invoke() to make a call back to the server and wait for the mojit to be dispatched.
Now, the RPC built-in in mojito for the tunnel requests will honor the middleware, so, if you have a middleware that validates the logging information, you should be able to control that in your controller for the invoked mojit, which is responsible for rendering the new result, or reporting an error. There is not need to involve the framemojit in this schema.