login and register function
login and register function