Updated Login

Updated login to check whether user exists and log them in successfully,
currently only works on localhost using a local database