better-auth
Version:
The most comprehensive authentication framework for TypeScript.
82 lines • 1.96 kB
text/typescript
import * as z from "zod";
//#region src/plugins/one-tap/index.d.ts
declare module "@better-auth/core" {
interface BetterAuthPluginRegistry<AuthOptions, Options> {
"one-tap": {
creator: typeof oneTap;
};
}
}
interface OneTapOptions {
/**
* Disable the signup flow
*
* @default false
*/
disableSignup?: boolean | undefined;
/**
* Google Client ID
*
* If a client ID is provided in the social provider configuration,
* it will be used.
*/
clientId?: string | undefined;
}
declare const oneTap: (options?: OneTapOptions | undefined) => {
id: "one-tap";
version: string;
endpoints: {
oneTapCallback: import("better-call").StrictEndpoint<"/one-tap/callback", {
method: "POST";
body: z.ZodObject<{
idToken: z.ZodString;
callbackURL: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
metadata: {
openapi: {
summary: string;
description: string;
responses: {
200: {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
session: {
$ref: string;
};
user: {
$ref: string;
};
};
};
};
};
};
400: {
description: string;
};
};
};
};
}, {
error: string;
} | {
token: string;
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
};
}>;
};
options: OneTapOptions | undefined;
};
//#endregion
export { OneTapOptions, oneTap };