Working version with saving email and password to database.