Implementation of login in database.