Support both email based and backward compatibility authentication