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:
parent
9ba7c0cdf0
commit
2a0ec7f78c
3 changed files with 8 additions and 3 deletions
5
.changeset-staged/nine-apes-attend.md
Normal file
5
.changeset-staged/nine-apes-attend.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@logto/connector-kit": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
`getSession` and `setSession` are actually used as REQUIRED parameters, update interface definition.
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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>>;
|
||||||
|
|
Loading…
Reference in a new issue