Finishing login with ajax