[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:
Muhsin Shah C P 2025-04-14 13:56:06 +05:30 committed by GitHub
parent 1c22cb97a5
commit 093ecbd1a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -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 },

View file

@ -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');
}