Fix Authentication function.

Create Registration function and Login function.