Got login mechanism working