You'll need a backend database server or service to keep track of authentication. There are a variety of plugins you can use, such as firebase or photon depending on whatever you are using for authentication. Or you can use the ajax object to post to a php/mysql database if you have a web server.
Assuming you don't have one, or know how to set one up (which may be beyond what these forums can help you with), you can still use something like the google play, facebook, or apple game center plugins to have your user log in with those services.