vona-cli-set-api 1.0.285 → 1.0.289
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/cli/templates/create/project/basic/boilerplate/package.original.json +1 -1
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/package.json +1 -1
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/src/service/passportAdapter.ts +3 -3
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/src/types/auth.ts +5 -0
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/src/types/index.ts +2 -0
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/src/types/jwt.ts +8 -0
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/src/types/passport.ts +0 -9
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IPassport, IPassportAdapter } from 'vona-module-a-user';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IPayloadDataOfPassport } from '../types/jwt.ts';
|
|
3
3
|
import { BeanBase } from 'vona';
|
|
4
4
|
import { Service } from 'vona-module-a-bean';
|
|
5
5
|
|
|
@@ -15,13 +15,13 @@ export class ServicePassportAdapter extends BeanBase implements IPassportAdapter
|
|
|
15
15
|
return passport;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
async serialize(passport: IPassport): Promise<
|
|
18
|
+
async serialize(passport: IPassport): Promise<IPayloadDataOfPassport> {
|
|
19
19
|
const userId = passport.user!.id;
|
|
20
20
|
const authId = passport.auth!.id;
|
|
21
21
|
return { userId, authId };
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
async deserialize(payloadData:
|
|
24
|
+
async deserialize(payloadData: IPayloadDataOfPassport): Promise<IPassport | undefined> {
|
|
25
25
|
const user = await this.bean.user.findOneById(payloadData.userId);
|
|
26
26
|
if (!user) return;
|
|
27
27
|
const auth = await this.bean.auth.findOne({ id: payloadData.authId });
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import type { TableIdentity } from 'table-identity';
|
|
2
|
-
import type { IPayloadDataBase } from 'vona-module-a-jwt';
|
|
3
|
-
|
|
4
|
-
export interface IPayloadData extends IPayloadDataBase {
|
|
5
|
-
userId: TableIdentity;
|
|
6
|
-
authId: TableIdentity;
|
|
7
|
-
token?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
1
|
export interface IPassportCustom {}
|
|
11
2
|
|
|
12
3
|
declare module 'vona-module-a-user' {
|