Modified login procedure, use the loginpage hook