auth UI
Browse files12345672 unmodified lines1011121314153 unmodified lines19202122232419 unmodified lines4445464748495051525354555657"use client";import { useUser } from "@/hooks/useUser";import { use } from "react";import { useMount } from "react-use";import { Button } from "@/components/ui/button";import Link from "next/link";2 unmodified lines}: {searchParams: Promise<{ code: string }>;}) {const { code } = use(searchParams);const { loginFromCode } = useUser();3 unmodified lines}});return (<div className="h-screen flex flex-col justify-center items-center"><div className="!rounded-2xl !p-0 !bg-white !border-neutral-100 min-w-xs text-center overflow-hidden ring-[8px] ring-white/20">19 unmodified lines<main className="space-y-4 p-6"><div><p className="text-sm text-neutral-700 mb-4 max-w-xs">If you are not redirected automatically, please click the buttonbelow:</p><Link href="/"><Button variant="black" className="relative">Go to Home</Button></Link></div></main></div>12345672 unmodified lines101112131415163 unmodified lines202122232425262728293019 unmodified lines5051525354555657585960616263646566676869"use client";import { useUser } from "@/hooks/useUser";import { use, useState } from "react";import { useMount, useTimeoutFn } from "react-use";import { Button } from "@/components/ui/button";import Link from "next/link";2 unmodified lines}: {searchParams: Promise<{ code: string }>;}) {const [showButton, setShowButton] = useState(false);const { code } = use(searchParams);const { loginFromCode } = useUser();3 unmodified lines}});useTimeoutFn(() => setShowButton(true),7000 // Show button after 5 seconds);return (<div className="h-screen flex flex-col justify-center items-center"><div className="!rounded-2xl !p-0 !bg-white !border-neutral-100 min-w-xs text-center overflow-hidden ring-[8px] ring-white/20">19 unmodified lines<main className="space-y-4 p-6"><div><p className="text-sm text-neutral-700 mb-4 max-w-xs">If you are not redirected automatically in the next 5 seconds,please click the button below</p>{showButton ? (<Link href="/"><Button variant="black" className="relative">Go to Home</Button></Link>) : (<p className="text-xs text-neutral-500">Please wait, we are logging you in...</p>)}</div></main></div>
app/auth/callback/page.tsx+21-9