expo-passkey
Version:
Passkey authentication for Expo apps with Better Auth integration
131 lines • 4.6 kB
TypeScript
/**
* @file Revoke passkey endpoint
* @description Implementation of the endpoint to revoke a WebAuthn passkey
*/
import type { Logger } from "../utils/logger";
import type { ResolvedSchemaConfig } from "../../types";
/**
* Create endpoint to revoke a passkey
*/
export declare const createRevokeEndpoint: (options: {
logger: Logger;
schemaConfig: ResolvedSchemaConfig;
}) => {
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
body: {
credentialId: string;
reason?: string | undefined;
};
} & {
method?: "POST" | undefined;
} & {
query?: Record<string, any> | undefined;
} & {
params?: Record<string, any>;
} & {
request?: Request;
} & {
headers?: HeadersInit;
} & {
asResponse?: boolean;
returnHeaders?: boolean;
use?: import("better-call").Middleware[];
path?: string;
} & {
asResponse?: AsResponse | undefined;
returnHeaders?: ReturnHeaders | undefined;
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
headers: Headers;
response: {
success: boolean;
};
} : {
success: boolean;
}>;
options: {
method: "POST";
body: import("zod").ZodObject<{
credentialId: import("zod").ZodString;
reason: import("zod").ZodOptional<import("zod").ZodString>;
}, "strip", import("zod").ZodTypeAny, {
credentialId: string;
reason?: string | undefined;
}, {
credentialId: string;
reason?: string | undefined;
}>;
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
session: {
session: Record<string, any> & {
id: string;
userId: string;
expiresAt: Date;
createdAt: Date;
updatedAt: Date;
token: string;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
};
user: Record<string, any> & {
id: string;
email: string;
emailVerified: boolean;
name: string;
createdAt: Date;
updatedAt: Date;
image?: string | null | undefined;
};
};
}>)[];
metadata: {
openapi: {
description: string;
tags: string[];
responses: {
200: {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
success: {
type: string;
};
};
};
};
};
};
404: {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
error: {
type: string;
properties: {
code: {
type: string;
};
message: {
type: string;
};
};
};
};
};
};
};
};
};
};
};
} & {
use: any[];
};
path: "/expo-passkey/revoke";
};
//# sourceMappingURL=revoke.d.ts.map