feat: redesign login modal
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
parent
05e45634b2
commit
77dd6ce2f9
|
|
@ -1,9 +1,8 @@
|
|||
import { RootPortal } from "@follow/components/ui/portal/index.js"
|
||||
import { PresentSheet } from "@follow/components/ui/sheet/Sheet.js"
|
||||
import { Outlet } from "react-router"
|
||||
|
||||
import { useLoginModalShow, useWhoami } from "~/atoms/user"
|
||||
import { PlainModal } from "~/components/ui/modal/stacked/custom-modal"
|
||||
import { DeclarativeModal } from "~/components/ui/modal/stacked/declarative-modal"
|
||||
import { useDailyTask } from "~/hooks/biz/useDailyTask"
|
||||
import { LoginModalContent } from "~/modules/auth/LoginModalContent"
|
||||
|
||||
|
|
@ -20,17 +19,13 @@ export const MobileRootLayout = () => {
|
|||
|
||||
{isAuthFail && !user && (
|
||||
<RootPortal>
|
||||
<DeclarativeModal
|
||||
id="login"
|
||||
CustomModalComponent={PlainModal}
|
||||
<PresentSheet
|
||||
open
|
||||
overlay
|
||||
contentClassName="overflow-visible pb-safe"
|
||||
title="Login"
|
||||
canClose={false}
|
||||
clickOutsideToDismiss={false}
|
||||
>
|
||||
<LoginModalContent canClose={false} runtime={"browser"} />
|
||||
</DeclarativeModal>
|
||||
hideHeader
|
||||
content={<LoginModalContent canClose={false} runtime={"browser"} />}
|
||||
/>
|
||||
</RootPortal>
|
||||
)}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,41 @@
|
|||
import { FollowIcon } from "@follow/components/icons/follow.jsx"
|
||||
import { useMobile } from "@follow/components/hooks/useMobile.js"
|
||||
import { Logo } from "@follow/components/icons/logo.js"
|
||||
import { AutoResizeHeight } from "@follow/components/ui/auto-resize-height/index.js"
|
||||
import { MotionButtonBase } from "@follow/components/ui/button/index.js"
|
||||
import { LoadingCircle } from "@follow/components/ui/loading/index.jsx"
|
||||
import { authProvidersConfig } from "@follow/constants"
|
||||
import type { LoginRuntime } from "@follow/shared/auth"
|
||||
import { loginHandler } from "@follow/shared/auth"
|
||||
import { stopPropagation } from "@follow/utils/dom"
|
||||
import clsx from "clsx"
|
||||
import { AnimatePresence, m } from "framer-motion"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import type { FC } from "react"
|
||||
import { Fragment, useEffect, useMemo, useRef, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { modalMontionConfig } from "~/components/ui/modal/stacked/constants"
|
||||
import { useCurrentModal } from "~/components/ui/modal/stacked/hooks"
|
||||
import type { AuthProvider } from "~/queries/users"
|
||||
import { useAuthProviders } from "~/queries/users"
|
||||
|
||||
interface LoginModalContentProps {
|
||||
runtime?: LoginRuntime
|
||||
canClose?: boolean
|
||||
}
|
||||
|
||||
const defaultProviders = {
|
||||
google: {
|
||||
id: "google",
|
||||
name: "Google",
|
||||
color: "#3b82f6",
|
||||
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z"/><path fill="currentColor" d="M12 5.5a6.5 6.5 0 1 0 6.326 8H13a1.5 1.5 0 0 1 0-3h7a1.5 1.5 0 0 1 1.5 1.5a9.5 9.5 0 1 1-2.801-6.736a1.5 1.5 0 1 1-2.116 2.127A6.475 6.475 0 0 0 12 5.5Z"/></g></svg>',
|
||||
},
|
||||
github: {
|
||||
id: "github",
|
||||
name: "GitHub",
|
||||
color: "#000000",
|
||||
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none"><path d="M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z"/><path fill="currentColor" d="M7.024 2.31a9.08 9.08 0 0 1 2.125 1.046A11.432 11.432 0 0 1 12 3c.993 0 1.951.124 2.849.355a9.08 9.08 0 0 1 2.124-1.045c.697-.237 1.69-.621 2.28.032c.4.444.5 1.188.571 1.756c.08.634.099 1.46-.111 2.28C20.516 7.415 21 8.652 21 10c0 2.042-1.106 3.815-2.743 5.043a9.456 9.456 0 0 1-2.59 1.356c.214.49.333 1.032.333 1.601v3a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-.991c-.955.117-1.756.013-2.437-.276c-.712-.302-1.208-.77-1.581-1.218c-.354-.424-.74-1.38-1.298-1.566a1 1 0 0 1 .632-1.898c.666.222 1.1.702 1.397 1.088c.48.62.87 1.43 1.63 1.753c.313.133.772.22 1.49.122L8 17.98a3.986 3.986 0 0 1 .333-1.581a9.455 9.455 0 0 1-2.59-1.356C4.106 13.815 3 12.043 3 10c0-1.346.483-2.582 1.284-3.618c-.21-.82-.192-1.648-.112-2.283l.005-.038c.073-.582.158-1.267.566-1.719c.59-.653 1.584-.268 2.28-.031Z"/></g></svg>',
|
||||
},
|
||||
}
|
||||
|
||||
export const LoginModalContent = (props: LoginModalContentProps) => {
|
||||
const modal = useCurrentModal()
|
||||
|
||||
|
|
@ -48,45 +66,78 @@ export const LoginModalContent = (props: LoginModalContentProps) => {
|
|||
}, [])
|
||||
|
||||
const disabled = !!loadingLockSet
|
||||
|
||||
const filteredDefaultProviders = useMemo(() => {
|
||||
if (!authProviders) return Object.values(defaultProviders)
|
||||
return Object.entries(defaultProviders)
|
||||
.filter(([key]) => authProviders[key])
|
||||
.map(([_, provider]) => provider)
|
||||
}, [authProviders])
|
||||
|
||||
const extraProviders = useMemo(() => {
|
||||
if (!authProviders) return []
|
||||
return Object.entries(authProviders)
|
||||
.filter(([key]) => !defaultProviders[key])
|
||||
.map(([_, provider]) => provider)
|
||||
}, [authProviders])
|
||||
|
||||
const isMobile = useMobile()
|
||||
|
||||
const Inner = (
|
||||
<>
|
||||
<div className="-mt-8 mb-4 flex items-center justify-center md:-mt-8">
|
||||
<Logo className="size-12" />
|
||||
</div>
|
||||
<div className="-mt-0 text-center">
|
||||
<span className="text-xl">
|
||||
{t("signin.sign_in_to")} <b>{APP_NAME}</b>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 flex flex-col gap-4">
|
||||
{filteredDefaultProviders.map((provider) => (
|
||||
<MotionButtonBase
|
||||
key={provider.id}
|
||||
className={clsx(
|
||||
"center h-[48px] rounded-[8px] font-sans text-base font-medium text-white lg:w-[320px]",
|
||||
disabled && "pointer-events-none opacity-50",
|
||||
"overflow-hidden",
|
||||
authProvidersConfig[provider.id]?.buttonClassName,
|
||||
)}
|
||||
disabled={disabled}
|
||||
onClick={() => {
|
||||
loginHandler(provider.id, runtime)
|
||||
setLoadingLockSet(provider.id)
|
||||
window.analytics?.capture("login", {
|
||||
type: provider.id,
|
||||
})
|
||||
}}
|
||||
>
|
||||
<LoginButtonContent isLoading={loadingLockSet === provider.id}>
|
||||
<i className={clsx("mr-2 text-xl", authProvidersConfig[provider.id].iconClassName)} />{" "}
|
||||
{t("signin.continue_with", { provider: provider.name })}
|
||||
</LoginButtonContent>
|
||||
</MotionButtonBase>
|
||||
))}
|
||||
|
||||
<AuthProvidersRender providers={extraProviders} />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
if (isMobile) {
|
||||
return Inner
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="center flex h-full" onClick={canClose ? modal.dismiss : undefined}>
|
||||
<m.div
|
||||
className="shadow-modal rounded-lg border border-border bg-theme-background p-4 px-8 pb-8"
|
||||
onClick={stopPropagation}
|
||||
{...modalMontionConfig}
|
||||
initial={{ opacity: 0, y: 10 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
exit={{ opacity: 0, y: 10, transition: { type: "tween" } }}
|
||||
transition={{ type: "spring" }}
|
||||
>
|
||||
<div className="mb-8 mt-4 text-center align-middle font-sans text-2xl font-bold leading-relaxed">
|
||||
<span className="text-xl">{t("signin.sign_in_to")}</span>
|
||||
<span className="center flex translate-y-px gap-2 font-theme text-accent">
|
||||
<FollowIcon className="size-4" />
|
||||
{APP_NAME}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-col gap-4">
|
||||
{Object.entries(authProviders || []).map(([key, provider]) => (
|
||||
<MotionButtonBase
|
||||
key={key}
|
||||
className={clsx(
|
||||
"center h-[48px] w-[320px] rounded-[8px] font-sans text-base font-medium text-white",
|
||||
disabled && "pointer-events-none opacity-50",
|
||||
"overflow-hidden",
|
||||
authProvidersConfig[key]?.buttonClassName,
|
||||
)}
|
||||
disabled={disabled}
|
||||
onClick={() => {
|
||||
loginHandler(key, runtime)
|
||||
setLoadingLockSet(key)
|
||||
window.analytics?.capture("login", {
|
||||
type: key,
|
||||
})
|
||||
}}
|
||||
>
|
||||
<LoginButtonContent isLoading={loadingLockSet === key}>
|
||||
<i className={clsx("mr-2 text-xl", authProvidersConfig[key].iconClassName)} />{" "}
|
||||
{t("signin.continue_with", { provider: provider.name })}
|
||||
</LoginButtonContent>
|
||||
</MotionButtonBase>
|
||||
))}
|
||||
<div className="rounded-xl border bg-background p-3 px-8 shadow-2xl shadow-stone-300 dark:border-neutral-700 dark:shadow-stone-800">
|
||||
{Inner}
|
||||
</div>
|
||||
</m.div>
|
||||
</div>
|
||||
|
|
@ -133,3 +184,50 @@ const LoginButtonContent = (props: { children: React.ReactNode; isLoading: boole
|
|||
</AnimatePresence>
|
||||
)
|
||||
}
|
||||
|
||||
export const AuthProvidersRender: FC<{
|
||||
providers: AuthProvider[]
|
||||
runtime?: LoginRuntime
|
||||
}> = ({ providers, runtime }) => {
|
||||
const [authProcessingLockSet, setAuthProcessingLockSet] = useState(() => new Set<string>())
|
||||
return (
|
||||
<AutoResizeHeight spring>
|
||||
{providers.length > 0 && (
|
||||
<ul className="relative flex items-center justify-center gap-3 pt-4 before:absolute before:inset-x-28 before:top-0 before:h-px before:bg-stone-200 before:content-[''] before:dark:bg-neutral-700">
|
||||
{providers.map((provider) => (
|
||||
<li key={provider.id}>
|
||||
<MotionButtonBase
|
||||
disabled={authProcessingLockSet.has(provider.id)}
|
||||
onClick={() => {
|
||||
if (authProcessingLockSet.has(provider.id)) return
|
||||
loginHandler(provider.id, runtime)
|
||||
|
||||
setAuthProcessingLockSet((prev) => {
|
||||
prev.add(provider.id)
|
||||
return new Set(prev)
|
||||
})
|
||||
}}
|
||||
>
|
||||
<div className="flex size-10 items-center justify-center rounded-full border bg-background dark:border-neutral-700">
|
||||
{!authProcessingLockSet.has(provider.id) ? (
|
||||
<Fragment>
|
||||
<span
|
||||
className="center inline-flex size-4"
|
||||
style={{ color: provider.color }}
|
||||
dangerouslySetInnerHTML={{ __html: provider.icon }}
|
||||
/>
|
||||
</Fragment>
|
||||
) : (
|
||||
<div className="center flex">
|
||||
<i className="i-mgc-loading-3-cute-re animate-spin opacity-50" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</MotionButtonBase>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</AutoResizeHeight>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,19 +14,15 @@ export const users = {
|
|||
}),
|
||||
}
|
||||
|
||||
export interface AuthProvider {
|
||||
name: string
|
||||
id: string
|
||||
color: string
|
||||
icon: string
|
||||
}
|
||||
export const useAuthProviders = () => {
|
||||
return useQuery({
|
||||
queryKey: ["providers"],
|
||||
queryFn: async () => (await getProviders()).data,
|
||||
placeholderData: {
|
||||
google: {
|
||||
id: "google",
|
||||
name: "Google",
|
||||
},
|
||||
github: {
|
||||
id: "github",
|
||||
name: "GitHub",
|
||||
},
|
||||
},
|
||||
queryFn: async () => (await getProviders()).data as Record<string, AuthProvider>,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ export interface PresentSheetProps {
|
|||
open?: boolean
|
||||
onOpenChange?: (value: boolean) => void
|
||||
title?: ReactNode
|
||||
hideHeader?: boolean
|
||||
zIndex?: number
|
||||
dismissible?: boolean
|
||||
defaultOpen?: boolean
|
||||
|
|
@ -35,6 +36,7 @@ export const PresentSheet = forwardRef<SheetRef, PropsWithChildren<PresentSheetP
|
|||
children,
|
||||
zIndex = MODAL_STACK_Z_INDEX,
|
||||
title,
|
||||
hideHeader,
|
||||
dismissible = true,
|
||||
defaultOpen,
|
||||
triggerAsChild,
|
||||
|
|
@ -123,7 +125,12 @@ export const PresentSheet = forwardRef<SheetRef, PropsWithChildren<PresentSheetP
|
|||
)}
|
||||
|
||||
{title ? (
|
||||
<Drawer.Title className="-mt-4 mb-4 flex justify-center px-4 text-lg font-medium">
|
||||
<Drawer.Title
|
||||
className={cn(
|
||||
"-mt-4 mb-4 flex justify-center px-4 text-lg font-medium",
|
||||
hideHeader && "sr-only",
|
||||
)}
|
||||
>
|
||||
{title}
|
||||
</Drawer.Title>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -24,12 +24,7 @@ declare const authPlugins: ({
|
|||
method: "GET";
|
||||
}> | undefined)?]>(...ctx: C): Promise<C extends [{
|
||||
asResponse: true;
|
||||
}] ? Response : {
|
||||
[k: string]: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
}>;
|
||||
}] ? Response : any>;
|
||||
path: "/get-providers";
|
||||
options: {
|
||||
method: "GET";
|
||||
|
|
@ -4735,10 +4730,10 @@ declare const user: drizzle_orm_pg_core.PgTableWithColumns<{
|
|||
emailVerified: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "emailVerified";
|
||||
tableName: "user";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
dataType: "boolean";
|
||||
columnType: "PgBoolean";
|
||||
data: boolean;
|
||||
driverParam: boolean;
|
||||
notNull: false;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
|
|
@ -4878,10 +4873,10 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|||
emailVerified: drizzle_orm_pg_core.PgColumn<{
|
||||
name: "emailVerified";
|
||||
tableName: "user";
|
||||
dataType: "date";
|
||||
columnType: "PgTimestamp";
|
||||
data: Date;
|
||||
driverParam: string;
|
||||
dataType: "boolean";
|
||||
columnType: "PgBoolean";
|
||||
data: boolean;
|
||||
driverParam: boolean;
|
||||
notNull: false;
|
||||
hasDefault: false;
|
||||
isPrimaryKey: false;
|
||||
|
|
@ -4968,7 +4963,7 @@ declare const usersOpenApiSchema: z.ZodObject<Omit<{
|
|||
id: z.ZodString;
|
||||
name: z.ZodNullable<z.ZodString>;
|
||||
email: z.ZodString;
|
||||
emailVerified: z.ZodNullable<z.ZodString>;
|
||||
emailVerified: z.ZodNullable<z.ZodBoolean>;
|
||||
image: z.ZodNullable<z.ZodString>;
|
||||
handle: z.ZodNullable<z.ZodString>;
|
||||
createdAt: z.ZodDate;
|
||||
|
|
@ -4976,7 +4971,7 @@ declare const usersOpenApiSchema: z.ZodObject<Omit<{
|
|||
}, "email">, z.UnknownKeysParam, z.ZodTypeAny, {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: Date;
|
||||
|
|
@ -4984,7 +4979,7 @@ declare const usersOpenApiSchema: z.ZodObject<Omit<{
|
|||
}, {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: Date;
|
||||
|
|
@ -6542,10 +6537,13 @@ declare const auth: {
|
|||
method: "GET";
|
||||
query: zod.ZodOptional<zod.ZodObject<{
|
||||
disableCookieCache: zod.ZodOptional<zod.ZodBoolean>;
|
||||
disableRefresh: zod.ZodOptional<zod.ZodBoolean>;
|
||||
}, "strip", zod.ZodTypeAny, {
|
||||
disableCookieCache?: boolean | undefined;
|
||||
disableRefresh?: boolean | undefined;
|
||||
}, {
|
||||
disableCookieCache?: boolean | undefined;
|
||||
disableRefresh?: boolean | undefined;
|
||||
}>>;
|
||||
requireHeaders: true;
|
||||
metadata: {
|
||||
|
|
@ -6599,12 +6597,7 @@ declare const auth: {
|
|||
method: "GET";
|
||||
}> | undefined)?]>(...ctx: C): Promise<C extends [{
|
||||
asResponse: true;
|
||||
}] ? Response : {
|
||||
[k: string]: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
}>;
|
||||
}] ? Response : any>;
|
||||
path: "/get-providers";
|
||||
options: {
|
||||
method: "GET";
|
||||
|
|
@ -6722,6 +6715,28 @@ declare const auth: {
|
|||
}>]>(...ctx: C): Promise<C extends [{
|
||||
asResponse: true;
|
||||
}] ? Response : {
|
||||
session: {
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
expiresAt: Date;
|
||||
token: string;
|
||||
ipAddress?: string | null | undefined;
|
||||
userAgent?: string | null | undefined;
|
||||
};
|
||||
user: {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string;
|
||||
emailVerified: boolean;
|
||||
name: string;
|
||||
image?: string | null | undefined;
|
||||
};
|
||||
url: undefined;
|
||||
redirect: boolean;
|
||||
} | {
|
||||
url: string;
|
||||
redirect: boolean;
|
||||
}>;
|
||||
|
|
@ -7989,20 +8004,20 @@ declare const auth: {
|
|||
<C extends [better_call.Context<"/update-user", {
|
||||
method: "POST";
|
||||
body: zod.ZodObject<{
|
||||
name: zod.ZodOptional<zod.ZodString>;
|
||||
image: zod.ZodOptional<zod.ZodString>;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
name?: string | undefined;
|
||||
image?: string | undefined;
|
||||
}, {
|
||||
name?: string | undefined;
|
||||
image?: string | undefined;
|
||||
}> & zod.ZodObject<{
|
||||
handle: zod.ZodString;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
handle: string;
|
||||
}, {
|
||||
handle: string;
|
||||
}> & zod.ZodObject<{
|
||||
name: zod.ZodOptional<zod.ZodString>;
|
||||
image: zod.ZodOptional<zod.ZodString | zod.ZodNull>;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
name?: string | undefined;
|
||||
image?: string | null | undefined;
|
||||
}, {
|
||||
name?: string | undefined;
|
||||
image?: string | null | undefined;
|
||||
}>;
|
||||
use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
|
||||
session: {
|
||||
|
|
@ -8077,20 +8092,20 @@ declare const auth: {
|
|||
options: {
|
||||
method: "POST";
|
||||
body: zod.ZodObject<{
|
||||
name: zod.ZodOptional<zod.ZodString>;
|
||||
image: zod.ZodOptional<zod.ZodString>;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
name?: string | undefined;
|
||||
image?: string | undefined;
|
||||
}, {
|
||||
name?: string | undefined;
|
||||
image?: string | undefined;
|
||||
}> & zod.ZodObject<{
|
||||
handle: zod.ZodString;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
handle: string;
|
||||
}, {
|
||||
handle: string;
|
||||
}> & zod.ZodObject<{
|
||||
name: zod.ZodOptional<zod.ZodString>;
|
||||
image: zod.ZodOptional<zod.ZodString | zod.ZodNull>;
|
||||
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
|
||||
name?: string | undefined;
|
||||
image?: string | null | undefined;
|
||||
}, {
|
||||
name?: string | undefined;
|
||||
image?: string | null | undefined;
|
||||
}>;
|
||||
use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
|
||||
session: {
|
||||
|
|
@ -8161,15 +8176,8 @@ declare const auth: {
|
|||
headers: Headers;
|
||||
};
|
||||
deleteUser: {
|
||||
<C extends [better_call.Context<"/delete-user", {
|
||||
<C extends [(better_call.Context<"/delete-user", {
|
||||
method: "POST";
|
||||
body: zod.ZodObject<{
|
||||
password: zod.ZodString;
|
||||
}, "strip", zod.ZodTypeAny, {
|
||||
password: string;
|
||||
}, {
|
||||
password: string;
|
||||
}>;
|
||||
use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
|
||||
session: {
|
||||
session: Record<string, any> & {
|
||||
|
|
@ -8210,19 +8218,15 @@ declare const auth: {
|
|||
};
|
||||
};
|
||||
};
|
||||
}>]>(...ctx: C): Promise<C extends [{
|
||||
}> | undefined)?]>(...ctx: C): Promise<C extends [{
|
||||
asResponse: true;
|
||||
}] ? Response : null>;
|
||||
}] ? Response : {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}>;
|
||||
path: "/delete-user";
|
||||
options: {
|
||||
method: "POST";
|
||||
body: zod.ZodObject<{
|
||||
password: zod.ZodString;
|
||||
}, "strip", zod.ZodTypeAny, {
|
||||
password: string;
|
||||
}, {
|
||||
password: string;
|
||||
}>;
|
||||
use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
|
||||
session: {
|
||||
session: Record<string, any> & {
|
||||
|
|
@ -9071,6 +9075,36 @@ declare const auth: {
|
|||
method: better_call.Method | better_call.Method[];
|
||||
headers: Headers;
|
||||
};
|
||||
deleteUserCallback: {
|
||||
<C extends [better_call.Context<"/delete-user/callback", {
|
||||
method: "GET";
|
||||
query: zod.ZodObject<{
|
||||
token: zod.ZodString;
|
||||
}, "strip", zod.ZodTypeAny, {
|
||||
token: string;
|
||||
}, {
|
||||
token: string;
|
||||
}>;
|
||||
}>]>(...ctx: C): Promise<C extends [{
|
||||
asResponse: true;
|
||||
}] ? Response : {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}>;
|
||||
path: "/delete-user/callback";
|
||||
options: {
|
||||
method: "GET";
|
||||
query: zod.ZodObject<{
|
||||
token: zod.ZodString;
|
||||
}, "strip", zod.ZodTypeAny, {
|
||||
token: string;
|
||||
}, {
|
||||
token: string;
|
||||
}>;
|
||||
};
|
||||
method: better_call.Method | better_call.Method[];
|
||||
headers: Headers;
|
||||
};
|
||||
};
|
||||
options: {
|
||||
appName: string;
|
||||
|
|
@ -9116,7 +9150,6 @@ declare const auth: {
|
|||
}): Promise<any>;
|
||||
options: better_auth_adapters_drizzle.DrizzleAdapterConfig;
|
||||
};
|
||||
baseUrl: string | undefined;
|
||||
basePath: string;
|
||||
trustedOrigins: string[];
|
||||
user: {
|
||||
|
|
@ -9126,25 +9159,29 @@ declare const auth: {
|
|||
};
|
||||
};
|
||||
};
|
||||
accounts: {
|
||||
account: {
|
||||
accountLinking: {
|
||||
enabled: boolean;
|
||||
trustedProviders: string[];
|
||||
enabled: true;
|
||||
trustedProviders: ("github" | "apple" | "google")[];
|
||||
};
|
||||
};
|
||||
socialProviders: {
|
||||
google: {
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
redirectURI: string;
|
||||
};
|
||||
github: {
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
redirectURI: string;
|
||||
};
|
||||
apple: {
|
||||
enabled: boolean;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
} | undefined;
|
||||
redirectURI: string;
|
||||
};
|
||||
};
|
||||
plugins: ({
|
||||
id: "custom-session";
|
||||
|
|
@ -9207,12 +9244,7 @@ declare const auth: {
|
|||
method: "GET";
|
||||
}> | undefined)?]>(...ctx: C): Promise<C extends [{
|
||||
asResponse: true;
|
||||
}] ? Response : {
|
||||
[k: string]: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
}>;
|
||||
}] ? Response : any>;
|
||||
path: "/get-providers";
|
||||
options: {
|
||||
method: "GET";
|
||||
|
|
@ -9726,7 +9758,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -9735,7 +9767,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -9766,7 +9798,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -9775,7 +9807,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -9786,7 +9818,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -9928,7 +9960,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10022,7 +10054,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10181,7 +10213,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10190,7 +10222,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10284,7 +10316,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10293,7 +10325,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10429,7 +10461,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10438,7 +10470,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10514,7 +10546,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10523,7 +10555,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10649,7 +10681,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
data: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10674,7 +10706,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
[x: string]: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10840,7 +10872,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10849,7 +10881,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10862,7 +10894,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
boosters: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10899,7 +10931,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10908,7 +10940,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10919,7 +10951,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -10947,7 +10979,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11184,7 +11216,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
fromUser?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11193,7 +11225,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
toUser?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11213,7 +11245,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11222,7 +11254,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11340,7 +11372,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
user: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11395,7 +11427,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11404,7 +11436,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11415,7 +11447,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11476,7 +11508,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11485,7 +11517,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11496,7 +11528,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11573,7 +11605,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11582,7 +11614,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11593,7 +11625,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11635,7 +11667,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11644,7 +11676,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
tipUsers?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11748,7 +11780,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11882,7 +11914,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
owner?: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
@ -11993,7 +12025,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
|
|||
data: {
|
||||
name: string | null;
|
||||
id: string;
|
||||
emailVerified: string | null;
|
||||
emailVerified: boolean | null;
|
||||
image: string | null;
|
||||
handle: string | null;
|
||||
createdAt: string;
|
||||
|
|
|
|||
Loading…
Reference in New Issue