Redirect_to won't work on earlier JavaScript call

i’m just trying to use YUI dialogs.
i’m using ActiveRBAC for login purposes and i’d like to use a YUI dialog
for login data.

here are two pasties:

this is my login page. a blank page with the dialog:
http://pastie.caboo.se/21032

this is the login controller.
http://pastie.caboo.se/21034

everthing works fine if the standard form tag is used.
but if the YUI dialog is used, the login will work but the
redirect isnt executed. am i missing something?

oh, i forgot. this is the rails action for redirecting.
could be unclearly cause its an action in ActiveRBAC

http://pastie.caboo.se/21038