File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -323,10 +323,12 @@ async def create(
323
323
user = await self .get_by_email (user_create .email )
324
324
325
325
# we must use the existing user in the session if it matches
326
- # the user we just got by email
327
- user_by_session = await db_session .get (User , user .id )
328
- if user_by_session :
329
- user = user_by_session
326
+ # the user we just got by email. Note that this only applies
327
+ # to multi-tenant, due to the overwriting of the user_db
328
+ if MULTI_TENANT :
329
+ user_by_session = await db_session .get (User , user .id )
330
+ if user_by_session :
331
+ user = user_by_session
330
332
331
333
# Handle case where user has used product outside of web and is now creating an account through web
332
334
if (
@@ -493,11 +495,13 @@ async def oauth_callback(
493
495
# Handle case where user has used product outside of web and is now creating an account through web
494
496
if not user .role .is_web_login ():
495
497
# We must use the existing user in the session if it matches
496
- # the user we just got by email/oauth
497
- if user .id :
498
- user_by_session = await db_session .get (User , user .id )
499
- if user_by_session :
500
- user = user_by_session
498
+ # the user we just got by email/oauth. Note that this only applies
499
+ # to multi-tenant, due to the overwriting of the user_db
500
+ if MULTI_TENANT :
501
+ if user .id :
502
+ user_by_session = await db_session .get (User , user .id )
503
+ if user_by_session :
504
+ user = user_by_session
501
505
502
506
await self .user_db .update (
503
507
user ,
You can’t perform that action at this time.
0 commit comments