rez_core 4.0.9 → 4.0.11
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/dist/module/auth/controller/auth.controller.d.ts +0 -3
- package/dist/module/auth/controller/auth.controller.js +0 -26
- package/dist/module/auth/controller/auth.controller.js.map +1 -1
- package/dist/module/auth/services/auth.service.js +3 -3
- package/dist/module/auth/services/auth.service.js.map +1 -1
- package/dist/module/meta/service/resolver.service.js +1 -1
- package/dist/module/meta/service/resolver.service.js.map +1 -1
- package/dist/module/user/entity/user-session.entity.d.ts +4 -0
- package/dist/module/user/entity/user-session.entity.js +16 -0
- package/dist/module/user/entity/user-session.entity.js.map +1 -1
- package/dist/module/user/entity/user.entity.d.ts +0 -4
- package/dist/module/user/entity/user.entity.js +0 -16
- package/dist/module/user/entity/user.entity.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/auth/controller/auth.controller.ts +15 -15
- package/src/module/auth/services/auth.service.ts +4 -4
- package/src/module/meta/service/resolver.service.ts +2 -2
- package/src/module/user/entity/user-session.entity.ts +12 -0
- package/src/module/user/entity/user.entity.ts +0 -12
- package/.vscode/extensions.json +0 -5
package/package.json
CHANGED
|
@@ -7,22 +7,22 @@ import { UAParser } from 'ua-parser-js';
|
|
|
7
7
|
export class AuthController {
|
|
8
8
|
constructor(private readonly authService: AuthService) {}
|
|
9
9
|
|
|
10
|
-
@Post('fcmtoken')
|
|
11
|
-
@UseGuards(JwtAuthGuard)
|
|
12
|
-
async getDashboard(@Req() req: any, @Body('fcmtoken') fcmtoken: string) {
|
|
13
|
-
|
|
10
|
+
// @Post('fcmtoken')
|
|
11
|
+
// @UseGuards(JwtAuthGuard)
|
|
12
|
+
// async getDashboard(@Req() req: any, @Body('fcmtoken') fcmtoken: string) {
|
|
13
|
+
// const loggedInUser = req.user.userData;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
// const ip =
|
|
16
|
+
// (req.headers['x-forwarded-for'] as string)?.split(',')[0].trim() ||
|
|
17
|
+
// req.socket.remoteAddress ||
|
|
18
|
+
// req.ip ||
|
|
19
|
+
// '';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
// const userAgent = req.headers['user-agent'] || '';
|
|
22
|
+
// const parser = new UAParser(userAgent);
|
|
23
|
+
// const browser = parser.getBrowser().name || 'Unknown';
|
|
24
|
+
// const os = parser.getOS().name || 'Unknown';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
}
|
|
26
|
+
// return this.authService.fcmtoken(fcmtoken, loggedInUser, ip, browser, os);
|
|
27
|
+
// }
|
|
28
28
|
}
|
|
@@ -35,14 +35,14 @@ export class AuthService {
|
|
|
35
35
|
browser: string,
|
|
36
36
|
os: string,
|
|
37
37
|
) {
|
|
38
|
-
const { id: userId,
|
|
38
|
+
const { id: userId, sessionToken } = loggedInUser;
|
|
39
39
|
|
|
40
40
|
// Update the sso_user table
|
|
41
41
|
await this.dataSource.query(
|
|
42
|
-
`UPDATE
|
|
42
|
+
`UPDATE sso_user_session
|
|
43
43
|
SET fcm_token = ?, ip = ?, browser = ?, os = ?
|
|
44
|
-
WHERE
|
|
45
|
-
[fcmtoken, ip, browser, os,
|
|
44
|
+
WHERE session_key = ? AND user_id = ? `,
|
|
45
|
+
[fcmtoken, ip, browser, os, sessionToken, userId],
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
return { message: 'FCM token updated successfully' };
|
|
@@ -229,8 +229,8 @@ export class ResolverService {
|
|
|
229
229
|
else if (attr.data_source_type === 'master') {
|
|
230
230
|
const [item] = await this.dataSource.query(
|
|
231
231
|
`SELECT id FROM frm_list_master_items
|
|
232
|
-
WHERE ${attr.data_source_attribute} = ? AND organization_id = ?`,
|
|
233
|
-
[displayValue, loggedInUser.organization_id],
|
|
232
|
+
WHERE ${attr.data_source_attribute} = ? AND organization_id = ? AND listtype = ?`,
|
|
233
|
+
[displayValue, loggedInUser.organization_id, attr.datasource_list],
|
|
234
234
|
);
|
|
235
235
|
return item?.id ?? displayValue;
|
|
236
236
|
}
|
|
@@ -58,4 +58,16 @@ export class UserSession {
|
|
|
58
58
|
nullable: true,
|
|
59
59
|
})
|
|
60
60
|
expiry_date: Date;
|
|
61
|
+
|
|
62
|
+
@Column({ type: 'varchar', nullable: true })
|
|
63
|
+
fcm_token: string;
|
|
64
|
+
|
|
65
|
+
@Column({ type: 'varchar', nullable: true })
|
|
66
|
+
browser: string;
|
|
67
|
+
|
|
68
|
+
@Column({ type: 'varchar', nullable: true })
|
|
69
|
+
ip: string;
|
|
70
|
+
|
|
71
|
+
@Column({ type: 'varchar', nullable: true })
|
|
72
|
+
os: string;
|
|
61
73
|
}
|
|
@@ -54,18 +54,6 @@ export class UserData extends BaseEntity {
|
|
|
54
54
|
@Column({ nullable: true })
|
|
55
55
|
date: Date;
|
|
56
56
|
|
|
57
|
-
@Column({ type: 'varchar', nullable: true })
|
|
58
|
-
fcm_token: string;
|
|
59
|
-
|
|
60
|
-
@Column({ type: 'varchar', nullable: true })
|
|
61
|
-
browser: string;
|
|
62
|
-
|
|
63
|
-
@Column({ type: 'varchar', nullable: true })
|
|
64
|
-
ip: string;
|
|
65
|
-
|
|
66
|
-
@Column({ type: 'varchar', nullable: true })
|
|
67
|
-
os: string;
|
|
68
|
-
|
|
69
57
|
@Column({ type: 'varchar', nullable: true })
|
|
70
58
|
profile_image: string;
|
|
71
59
|
}
|