From c9d6031156f31520e6ef1d1ff3cacb755644e00e Mon Sep 17 00:00:00 2001 From: adepojuemmanuel235 Date: Sat, 3 Oct 2026 13:53:10 +0000 Subject: [PATCH 1/3] Landing says 'Settled in USDG'; clearer sign-in for returning users and after sign-out Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- app/app/page.tsx | 8 +++++++- app/app/signin/sign-in.tsx | 11 ++++++++--- app/components/app/session.tsx | 17 ++++++++++++----- app/components/app/shell.tsx | 2 +- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/app/app/page.tsx b/app/app/page.tsx index 6705b83..f7a4351 100644 --- a/app/app/page.tsx +++ b/app/app/page.tsx @@ -70,7 +70,7 @@ export default function Landing() {
-

Testnet prototype ยท settled in test USDG

+

Settled in USDG

Book every supplier together. Release deposits only when all of them say yes.

@@ -85,6 +85,12 @@ export default function Landing() { Create a package
+

+ Already use Setlo?{" "} + + Sign in + +

diff --git a/app/app/signin/sign-in.tsx b/app/app/signin/sign-in.tsx index fa2882f..b35eab4 100644 --- a/app/app/signin/sign-in.tsx +++ b/app/app/signin/sign-in.tsx @@ -20,7 +20,9 @@ export function SignIn() { const { ready, authenticated } = usePrivy(); const { sendCode, loginWithCode, state } = useLoginWithEmail(); const router = useRouter(); - const next = safeNext(useSearchParams().get("next")); + const params = useSearchParams(); + const next = safeNext(params.get("next")); + const signedOut = params.get("signedout") === "1"; const [email, setEmail] = useState(""); const [code, setCode] = useState(""); const [error, setError] = useState(null); @@ -50,14 +52,17 @@ export function SignIn() { -

{sent ? "Check your email" : "Sign in"}

+

{sent ? "Check your email" : "Sign in or create an account"}

{sent ? `We sent a 6-digit code to ${email}. It may take a minute, and can land in spam.` : invite ? "Use the email address your invitation was sent to. You'll go straight to it after signing in." - : "We'll email you a sign-in code. No password or crypto wallet needed."} + : "Enter your email and we'll send a code. No password or crypto wallet needed. If you've used Setlo before, you'll get back the same bookings and payout account."}

+ {signedOut && !sent && !error && ( + You're signed out. Sign in with the same email to get back to your bookings. + )} {error && {error}} {!sent ? (
{ e.preventDefault(); void run(() => sendCode({ email: email.trim() })); }}> diff --git a/app/components/app/session.tsx b/app/components/app/session.tsx index eab14b7..e9125cd 100644 --- a/app/components/app/session.tsx +++ b/app/components/app/session.tsx @@ -2,7 +2,7 @@ import { useCreateWallet, usePrivy, useSignTypedData, useWallets } from "@privy-io/react-auth"; import { usePathname, useRouter } from "next/navigation"; -import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react"; +import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; import type { Address, EIP1193Provider, Hex } from "viem"; import { Button } from "@/components/ui/button"; import { ErrorState } from "@/components/ui/status"; @@ -42,10 +42,17 @@ export function RequireSession({ children }: { children: React.ReactNode }) { const [error, setError] = useState(null); const [attempt, setAttempt] = useState(0); + const leaving = useRef(false); useEffect(() => { - if (ready && !authenticated) router.replace(`/signin?next=${encodeURIComponent(path)}`); + if (ready && !authenticated && !leaving.current) router.replace(`/signin?next=${encodeURIComponent(path)}`); }, [ready, authenticated, router, path]); + const signOut = useCallback(async () => { + leaving.current = true; + await logout(); + router.replace("/signin?signedout=1"); + }, [logout, router]); + const embedded = wallets.find((w) => w.walletClientType === "privy"); const address = (user?.wallet?.address ?? embedded?.address) as Address | undefined; @@ -96,8 +103,8 @@ export function RequireSession({ children }: { children: React.ReactNode }) { (id) => own.switchChain(id), async (req) => (await signTypedData(JSON.parse(JSON.stringify(req)), { address: synced })).signature as Hex, ); - return { email: user.email.address.toLowerCase(), wallet: synced, signer, api, logout }; - }, [synced, own, user, signTypedData, api, logout]); + return { email: user.email.address.toLowerCase(), wallet: synced, signer, api, logout: signOut }; + }, [synced, own, user, signTypedData, api, signOut]); if (!ready || !authenticated) return ; if (error && !session) @@ -108,7 +115,7 @@ export function RequireSession({ children }: { children: React.ReactNode }) { ); if (walletsReady && synced && !own) return ( - logout()}>Sign out}> + void signOut()}>Sign out}> This browser can't reach the payout account registered to your email ({synced}). Sign out and sign in again. ); diff --git a/app/components/app/shell.tsx b/app/components/app/shell.tsx index 0cbfed6..80181b3 100644 --- a/app/components/app/shell.tsx +++ b/app/components/app/shell.tsx @@ -38,7 +38,7 @@ export function Footer() {
-

Shared booking and settlement for event agencies, clients and suppliers. Testnet prototype, settled in test USDG.

+

Shared booking and settlement for event agencies, clients and suppliers. Settled in USDG.

-

- Test networks only. USDG here is test money with no value. Paxos can pause USDG or freeze addresses, including the Setlo contract. -

+
+

Test networks only. USDG here is test money with no value. Paxos can pause USDG or freeze addresses, including the Setlo contract.

+ +
);