Updated public login methodt