improving server side login code with different auth file