[#59] refractor if statement in auth method