diff --git a/.changeset-staged/nine-apes-attend.md b/.changeset-staged/nine-apes-attend.md new file mode 100644 index 000000000..aa8ee9443 --- /dev/null +++ b/.changeset-staged/nine-apes-attend.md @@ -0,0 +1,5 @@ +--- +"@logto/connector-kit": minor +--- + +`getSession` and `setSession` are actually used as REQUIRED parameters, update interface definition. diff --git a/packages/core/src/libraries/social.ts b/packages/core/src/libraries/social.ts index e22648475..462135926 100644 --- a/packages/core/src/libraries/social.ts +++ b/packages/core/src/libraries/social.ts @@ -65,7 +65,7 @@ export const createSocialLibrary = (queries: Queries, connectorLibrary: Connecto const getUserInfoByAuthCode = async ( connectorId: string, data: unknown, - getConnectorSession?: GetSession + getConnectorSession: GetSession ): Promise => { const connector = await getConnector(connectorId); diff --git a/packages/toolkit/connector-kit/src/types.ts b/packages/toolkit/connector-kit/src/types.ts index 2ea427157..3036587c4 100644 --- a/packages/toolkit/connector-kit/src/types.ts +++ b/packages/toolkit/connector-kit/src/types.ts @@ -191,7 +191,7 @@ export type GetAuthorizationUri = ( jti: string; headers: { userAgent?: string }; }, - setSession?: SetSession + setSession: SetSession ) => Promise; export const socialUserInfoGuard = z.object({ @@ -206,5 +206,5 @@ export type SocialUserInfo = z.infer; export type GetUserInfo = ( data: unknown, - getSession?: GetSession + getSession: GetSession ) => Promise>;