Finished login logic