Added HTTPS and register user logic