How to override login action

By ping
 


Hi There

I am trying to code a plugin that encode the plain text password with RSA, and decode the password later.

To achieve this, I need to override the system login action to do the decode before verifying the password. Could anyone tell me how? I tried

elgg_register_event_handler('login', 'user', 'rsa_login_decode'), but seems
the system action is called before rsa_login_decode and would return false. So
rsa_login_decode won't be called.

 

Thank you!