mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
[post-modularisation] [fixed] User isn't being added to the new workspace after being archived from other workspaces, when logging in from the instance. (#12557)
* fixed: user isn't adding to new workspace after archived from other workspaces * fixed: password login support
This commit is contained in:
parent
1c22cb97a5
commit
093ecbd1a9
2 changed files with 4 additions and 2 deletions
|
|
@ -221,7 +221,7 @@ export class OauthService implements IOAuthService {
|
|||
if (!isInviteRedirect) {
|
||||
// no SSO login enabled organization available for user - creating new one
|
||||
const { name, slug } = generateNextNameAndSlug('My workspace');
|
||||
organizationDetails = await this.setupOrganizationsUtilService.create(name, slug, null, manager);
|
||||
organizationDetails = await this.setupOrganizationsUtilService.create(name, slug, userDetails, manager);
|
||||
await this.userRepository.updateOne(
|
||||
userDetails.id,
|
||||
{ defaultOrganizationId: organizationDetails.id },
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import { UserRepository } from '../users/repository';
|
|||
import { AuthUtilService } from './util.service';
|
||||
import { SessionUtilService } from '../session/util.service';
|
||||
import { IAuthService } from './interfaces/IService';
|
||||
import { SetupOrganizationsUtilService } from '@modules/setup-organization/util.service';
|
||||
|
||||
@Injectable()
|
||||
export class AuthService implements IAuthService {
|
||||
|
|
@ -28,6 +29,7 @@ export class AuthService implements IAuthService {
|
|||
protected sessionUtilService: SessionUtilService,
|
||||
protected organizationRepository: OrganizationRepository,
|
||||
protected instanceSettingsUtilService: InstanceSettingsUtilService,
|
||||
protected setupOrganizationsUtilService: SetupOrganizationsUtilService,
|
||||
protected eventEmitter: EventEmitter2
|
||||
) {}
|
||||
|
||||
|
|
@ -81,7 +83,7 @@ export class AuthService implements IAuthService {
|
|||
} else if (allowPersonalWorkspace && !isInviteRedirect) {
|
||||
// no form login enabled organization available for user - creating new one
|
||||
const { name, slug } = generateNextNameAndSlug('My workspace');
|
||||
organization = await this.organizationRepository.createOne(name, slug, manager);
|
||||
organization = await this.setupOrganizationsUtilService.create(name, slug, user, manager);
|
||||
} else {
|
||||
if (!isInviteRedirect) throw new UnauthorizedException('User is not assigned to any workspaces');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue