File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
packages/plugin-multi-tenant/src/providers/TenantSelectionProvider Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,15 @@ export const TenantSelectionProviderClient = ({
187
187
// Users with no cookie set and only 1 tenant should set that tenant automatically
188
188
setTenant ( { id : tenantOptionsFromProps [ 0 ] ?. value , refresh : true } )
189
189
setTenantOptions ( tenantOptionsFromProps )
190
- } else if ( ( ! tenantOptions || tenantOptions . length === 0 ) && tenantOptionsFromProps ) {
190
+ } else if (
191
+ ( ! tenantOptions || tenantOptions . length === 0 ) &&
192
+ tenantOptionsFromProps . length > 0
193
+ ) {
194
+ // If there are no tenant options, set them from the props
195
+ setTenantOptions ( tenantOptionsFromProps )
196
+ }
197
+ } else if ( userID && tenantCookie ) {
198
+ if ( ( ! tenantOptions || tenantOptions . length === 0 ) && tenantOptionsFromProps . length > 0 ) {
191
199
// If there are no tenant options, set them from the props
192
200
setTenantOptions ( tenantOptionsFromProps )
193
201
}
Original file line number Diff line number Diff line change @@ -160,7 +160,6 @@ test.describe('Multi Tenant', () => {
160
160
data : credentials . admin ,
161
161
} )
162
162
await page . goto ( globalMenuURL . list )
163
- await page . waitForURL ( globalMenuURL . create )
164
163
await expect ( page . locator ( '.collection-edit' ) ) . toBeVisible ( )
165
164
} )
166
165
@@ -282,6 +281,7 @@ test.describe('Multi Tenant', () => {
282
281
urlUtil : tenantsURL ,
283
282
} )
284
283
284
+ await expect ( page . locator ( '#field-name' ) ) . toBeVisible ( )
285
285
await page . locator ( '#field-name' ) . fill ( 'Red Dog' )
286
286
await saveDocAndAssert ( page )
287
287
Original file line number Diff line number Diff line change @@ -159,6 +159,13 @@ export interface User {
159
159
hash ?: string | null ;
160
160
loginAttempts ?: number | null ;
161
161
lockUntil ?: string | null ;
162
+ sessions ?:
163
+ | {
164
+ id : string ;
165
+ createdAt ?: string | null ;
166
+ expiresAt : string ;
167
+ } [ ]
168
+ | null ;
162
169
password ?: string | null ;
163
170
}
164
171
/**
@@ -291,6 +298,13 @@ export interface UsersSelect<T extends boolean = true> {
291
298
hash ?: T ;
292
299
loginAttempts ?: T ;
293
300
lockUntil ?: T ;
301
+ sessions ?:
302
+ | T
303
+ | {
304
+ id ?: T ;
305
+ createdAt ?: T ;
306
+ expiresAt ?: T ;
307
+ } ;
294
308
}
295
309
/**
296
310
* This interface was referenced by `Config`'s JSON-Schema
You can’t perform that action at this time.
0 commit comments