Added database support for login