mod: server authentication refactoring