@appxdigital/appx-core 0.1.71 → 0.1.72
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.
|
@@ -4,6 +4,6 @@ export declare class SessionSerializer extends PassportSerializer {
|
|
|
4
4
|
private prisma;
|
|
5
5
|
constructor(prisma: PrismaService);
|
|
6
6
|
serializeUser(user: any, done: Function): void;
|
|
7
|
-
deserializeUser(userId: string, done: Function): Promise<
|
|
7
|
+
deserializeUser(userId: string, done: Function): Promise<any>;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=session-serializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-serializer.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/session/session-serializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAE7D,qBACa,iBAAkB,SAAQ,kBAAkB;IACzC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAIzC,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ;IAIjC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"session-serializer.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/session/session-serializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAE7D,qBACa,iBAAkB,SAAQ,kBAAkB;IACzC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAIzC,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ;IAIjC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;CAqBvD"}
|
|
@@ -22,6 +22,9 @@ let SessionSerializer = class SessionSerializer extends passport_1.PassportSeria
|
|
|
22
22
|
done(null, user.id);
|
|
23
23
|
}
|
|
24
24
|
async deserializeUser(userId, done) {
|
|
25
|
+
if (!userId) {
|
|
26
|
+
return done(new Error('No userId provided'), null);
|
|
27
|
+
}
|
|
25
28
|
try {
|
|
26
29
|
const user = await this.prisma.user.findUniqueOrThrow({
|
|
27
30
|
where: { id: Number(userId) },
|
|
@@ -36,6 +39,7 @@ let SessionSerializer = class SessionSerializer extends passport_1.PassportSeria
|
|
|
36
39
|
done(null, user);
|
|
37
40
|
}
|
|
38
41
|
catch (error) {
|
|
42
|
+
console.debug('Error deserializing user:', error);
|
|
39
43
|
done(new Error('User not found'), null);
|
|
40
44
|
}
|
|
41
45
|
}
|
package/package.json
CHANGED