rez_core 4.0.197 → 4.0.199

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "4.0.197",
3
+ "version": "4.0.199",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -45,4 +45,7 @@ export class LinkedAttributes extends BaseEntity {
45
45
  nullable: true,
46
46
  })
47
47
  saved_filter_code: string;
48
+
49
+ @Column({ nullable: true })
50
+ sequence: number;
48
51
  }
@@ -117,6 +117,7 @@ export class OtpService {
117
117
  return this.loginService.login({
118
118
  email_id: identifier,
119
119
  is_otp: true,
120
+ subdomain,
120
121
  });
121
122
  }
122
123
 
@@ -28,12 +28,13 @@ export class LoginController {
28
28
 
29
29
  @Post('login')
30
30
  async login(@Body() body, @Res() res: Response) {
31
- const { email_id, password } = body;
31
+ const { email_id, password, subdomain } = body;
32
32
 
33
33
  const result = await this.loginService.login({
34
34
  email_id,
35
35
  password,
36
36
  is_otp: false, // default since you had it before
37
+ subdomain,
37
38
  });
38
39
 
39
40
  return res.status(HttpStatus.OK).json(result);
@@ -38,13 +38,35 @@ export class LoginService {
38
38
  masterKey: string = this.configService.get('MASTER_KEY') || '';
39
39
  masterIv: string = this.configService.get('MASTER_IV') || '';
40
40
 
41
- async login(data: { email_id: string; password?: string; is_otp?: boolean }) {
42
- const { email_id, password, is_otp = false } = data;
41
+ async login(data: {
42
+ email_id: string;
43
+ password?: string;
44
+ is_otp?: boolean;
45
+ subdomain?: string;
46
+ }): Promise<any> {
47
+ const { email_id, password, is_otp = false, subdomain } = data;
43
48
 
44
49
  let organization;
45
50
 
51
+ if (subdomain) {
52
+ organization =
53
+ await this.organizationRepository.findOrganizationBySubdomain(
54
+ subdomain,
55
+ );
56
+
57
+ if (!organization) {
58
+ return {
59
+ success: false,
60
+ message: 'Organization not found.',
61
+ };
62
+ }
63
+ }
64
+
46
65
  // 🔹 Step 2: Find the user by email + organization check
47
- const user = await this.userService.findByEmailId(email_id);
66
+ const user = await this.userService.findByEmailId(
67
+ email_id,
68
+ organization?.id,
69
+ );
48
70
 
49
71
  if (!user || (organization && user.organization_id !== organization.id)) {
50
72
  return {