@@ -6,6 +6,7 @@ import type {
|
||||
AuthAuditLogsResponse,
|
||||
AuthBindingStatus,
|
||||
AuthEntryResponse,
|
||||
AuthLoginOptionsResponse,
|
||||
AuthLiftRiskBlockResponse,
|
||||
AuthLoginMethod,
|
||||
AuthLogoutAllResponse,
|
||||
@@ -151,6 +152,14 @@ export async function buildAuthMeResponse(
|
||||
};
|
||||
}
|
||||
|
||||
export function buildAuthLoginOptionsResponse(
|
||||
context: AppContext,
|
||||
): AuthLoginOptionsResponse {
|
||||
return {
|
||||
availableLoginMethods: resolveAvailableLoginMethods(context),
|
||||
};
|
||||
}
|
||||
|
||||
async function signUserAuthPayload(
|
||||
context: AppContext,
|
||||
user: UserRecord,
|
||||
@@ -1077,12 +1086,14 @@ export async function startWechatLogin(
|
||||
context: AppContext,
|
||||
callbackUrl: string,
|
||||
redirectPath: string,
|
||||
requestContext: RefreshSessionRequestContext | null = null,
|
||||
): Promise<AuthWechatStartResponse> {
|
||||
const stateRecord = context.wechatAuthStates.create(redirectPath);
|
||||
return {
|
||||
authorizationUrl: context.wechatAuthService.buildAuthorizationUrl({
|
||||
callbackUrl,
|
||||
state: stateRecord.state,
|
||||
userAgent: requestContext?.userAgent ?? null,
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user