updated user auth example with ajax