Base login controller logic