Partial implementation of login