0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

refactor: update connector interfaces (#3080)

This commit is contained in:
Darcy Ye 2023-02-09 15:39:50 +08:00 committed by GitHub
parent 9ba7c0cdf0
commit 2a0ec7f78c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"@logto/connector-kit": minor
---
`getSession` and `setSession` are actually used as REQUIRED parameters, update interface definition.

View file

@ -65,7 +65,7 @@ export const createSocialLibrary = (queries: Queries, connectorLibrary: Connecto
const getUserInfoByAuthCode = async ( const getUserInfoByAuthCode = async (
connectorId: string, connectorId: string,
data: unknown, data: unknown,
getConnectorSession?: GetSession getConnectorSession: GetSession
): Promise<SocialUserInfo> => { ): Promise<SocialUserInfo> => {
const connector = await getConnector(connectorId); const connector = await getConnector(connectorId);

View file

@ -191,7 +191,7 @@ export type GetAuthorizationUri = (
jti: string; jti: string;
headers: { userAgent?: string }; headers: { userAgent?: string };
}, },
setSession?: SetSession setSession: SetSession
) => Promise<string>; ) => Promise<string>;
export const socialUserInfoGuard = z.object({ export const socialUserInfoGuard = z.object({
@ -206,5 +206,5 @@ export type SocialUserInfo = z.infer<typeof socialUserInfoGuard>;
export type GetUserInfo = ( export type GetUserInfo = (
data: unknown, data: unknown,
getSession?: GetSession getSession: GetSession
) => Promise<SocialUserInfo & Record<string, string | boolean | number | undefined>>; ) => Promise<SocialUserInfo & Record<string, string | boolean | number | undefined>>;