Skip to content

Commit 1148226

Browse files
committed
canonical determination of authority
1 parent 50ee048 commit 1148226

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

h/views/api/auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from h import models
1414
from h.models import User
1515
from h.services.oauth import DEFAULT_SCOPES
16+
from h.services.user_signup import UserSignupService
17+
1618
from h.util.datetime import utc_iso8601
1719
from h.views.api.config import api_config
1820
from h.views.api.exceptions import OAuthAuthorizeError, OAuthTokenError
@@ -168,7 +170,7 @@ def _authorized_response(self):
168170
# TOSDR : create user in h if it does not exist
169171
if not user:
170172
password = ''.join(random.choice(string.printable) for i in range(12))
171-
user = User(username=user_tosdr.username, email=user_tosdr.email, privacy_accepted=datetime.now(), comms_opt_in=False, authority='tosdr', password=password)
173+
user = User(username=user_tosdr.username, email=user_tosdr.email, privacy_accepted=datetime.now(), comms_opt_in=False, password=password, authority=self.request.default_authority)
172174
self.session.add(user)
173175

174176
credentials = {"user": user}

0 commit comments

Comments
 (0)