WebThingsIO / registration_server

The registration server for WebThings Gateway.
Mozilla Public License 2.0
79 stars 34 forks source link

Internal server error when trying to subscribe a subdomain for the second time #9

Closed andrenatal closed 7 years ago

andrenatal commented 7 years ago

After I run the server for the first time with a clean database, the first call to /subscription works fine, but the subsequent ones returns with an Internal server error. If I remove the database and starts again, the same behavior repeats.

andrenatal commented 7 years ago

Problem is here. For some reason, this db operation is returning an error.

andrenatal commented 7 years ago

Found the issue. There's a unique constraint in the email field. Email can't be unique, since we'll ask user's email only after we issue the certificates.

fabricedesre commented 7 years ago

I don't follow... if you already have a token, you need to use it instead of calling /subscribe again.

fabricedesre commented 7 years ago

Ok, so you just want to register different domains with the same email & public ip. Yep we need to allow that.