Cross Events 3.0.0: sign-in through the church's Accounts
Settings -> Sign-in: check, move (everyone into Accounts with their password hashes and authenticator apps, count/hash check, then switch) and undo for 14 days. Sign-in through auth-client with a one-time handoff to Events' own token; staff roles stepped up to mfa; sign-out and back-channel logout; user.updated/export/deleted; admin 2FA reset, unlock and profile changes via Accounts; /login, /register, /forgot-password forward once moved; Events' own sign-in endpoints answer SIGN_IN_MOVED. User.accountId, AccountsSignIn. npm run test:accounts runs Events' code against the real Accounts app (11 tests); 5 new Jest tests. MIGRATING-TO-3.md, plan "Changes while building". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { AccountsGate } from "@/components/auth/AccountsGate";
|
||||
import { useState } from "react";
|
||||
import { Navbar } from "@/components/layout/Navbar";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
@@ -6,7 +7,7 @@ import { KeyRound } from "lucide-react";
|
||||
import { errorMessage } from "@/lib/utils";
|
||||
import { apiV2Data } from "@/lib/apiV2";
|
||||
|
||||
export default function ForgotPasswordPage() {
|
||||
function ForgotPasswordPageLocal() {
|
||||
const [email, setEmail] = useState("");
|
||||
const [status, setStatus] = useState<string | null>(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -59,3 +60,8 @@ export default function ForgotPasswordPage() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// 3.0.0: forwards to the church's Accounts once sign-in has moved there (components/auth/AccountsGate).
|
||||
export default function ForgotPasswordPage() {
|
||||
return <AccountsGate kind="forgot"><ForgotPasswordPageLocal /></AccountsGate>;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
"use client";
|
||||
import { AccountsGate } from "@/components/auth/AccountsGate";
|
||||
import React, { Suspense } from "react";
|
||||
import { Navbar } from "@/components/layout/Navbar";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
import { LoginForm } from "@/components/auth/LoginForm";
|
||||
import { LogIn } from "lucide-react";
|
||||
|
||||
export default function LoginPage() {
|
||||
function LoginPageLocal() {
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
<Navbar />
|
||||
@@ -29,3 +30,8 @@ export default function LoginPage() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// 3.0.0: forwards to the church's Accounts once sign-in has moved there (components/auth/AccountsGate).
|
||||
export default function LoginPage() {
|
||||
return <AccountsGate kind="login"><LoginPageLocal /></AccountsGate>;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
"use client";
|
||||
import { AccountsGate } from "@/components/auth/AccountsGate";
|
||||
import React, { Suspense } from "react";
|
||||
import { Navbar } from "@/components/layout/Navbar";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
import { RegisterForm } from "@/components/auth/RegisterForm";
|
||||
import { UserPlus } from "lucide-react";
|
||||
|
||||
export default function RegisterPage() {
|
||||
function RegisterPageLocal() {
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
<Navbar />
|
||||
@@ -29,3 +30,8 @@ export default function RegisterPage() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// 3.0.0: forwards to the church's Accounts once sign-in has moved there (components/auth/AccountsGate).
|
||||
export default function RegisterPage() {
|
||||
return <AccountsGate kind="register"><RegisterPageLocal /></AccountsGate>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { AccountsGate } from "@/components/auth/AccountsGate";
|
||||
import React, { Suspense, useMemo, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { Navbar } from "@/components/layout/Navbar";
|
||||
@@ -89,10 +90,14 @@ function ActivateAccountContent() {
|
||||
);
|
||||
}
|
||||
|
||||
export default function ActivateAccountPage() {
|
||||
function ActivateAccountPageLocal() {
|
||||
return (
|
||||
<Suspense fallback={<div className="p-6">Loading...</div>}>
|
||||
<ActivateAccountContent />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
}
|
||||
// 3.0.0: forwards to the church's Accounts once sign-in has moved there (components/auth/AccountsGate).
|
||||
export default function ActivateAccountPage() {
|
||||
return <AccountsGate kind="activate"><ActivateAccountPageLocal /></AccountsGate>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
"use client";
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { API_BASE } from "@/lib/api";
|
||||
import { saveToken } from "@/lib/auth";
|
||||
import { safePath, signInHref } from "@/lib/signIn";
|
||||
|
||||
/**
|
||||
* Back from the church's Accounts (3.0.0, docs/EVENTS-3.0-PLAN.md §3): the one-time code in the
|
||||
* address's fragment (never sent to a server or in a Referer) is swapped for Events' own token,
|
||||
* then on to the page the person started on.
|
||||
*/
|
||||
export default function SignInCompletePage() {
|
||||
const [failed, setFailed] = useState<string | null>(null);
|
||||
useEffect(() => {
|
||||
const code = window.location.hash.slice(1);
|
||||
// Out of the address bar and the history straight away.
|
||||
window.history.replaceState(null, "", "/auth/complete");
|
||||
if (!code) {
|
||||
setFailed("This sign-in link has already been used.");
|
||||
return;
|
||||
}
|
||||
fetch(`${API_BASE}/api/auth/handoff`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ code }) })
|
||||
.then(async (r) => {
|
||||
const j = await r.json().catch(() => null);
|
||||
if (!r.ok || !j?.data?.token) throw new Error(j?.error?.message || "This sign-in has expired. Please sign in again.");
|
||||
saveToken(j.data.token);
|
||||
// A full page load, so the whole app starts signed in.
|
||||
window.location.replace(safePath(j.data.returnTo));
|
||||
})
|
||||
.catch((e: Error) => setFailed(e.message));
|
||||
}, []);
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center p-6">
|
||||
{failed ? (
|
||||
<div className="w-full max-w-md border rounded-2xl p-8 bg-white shadow-sm">
|
||||
<h1 className="text-xl font-semibold text-gray-900 mb-2">We couldn't sign you in</h1>
|
||||
<p className="text-sm text-gray-600 mb-6">{failed}</p>
|
||||
<a href={signInHref("/dashboard")} className="inline-block w-full text-center px-4 py-2.5 rounded-lg bg-brand-600 text-white text-sm font-medium">Sign in again</a>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-gray-500" role="status">Signing you in…</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
"use client";
|
||||
|
||||
import React, { Suspense } from "react";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { Navbar } from "@/components/layout/Navbar";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
import { safePath, signInHref } from "@/lib/signIn";
|
||||
|
||||
/** When signing in through the church's Accounts didn't work (3.0.0): what happened, and Try again. */
|
||||
const MESSAGES: Record<string, { title: string; text: string; retry?: boolean }> = {
|
||||
EXPIRED: { title: "That sign-in expired", text: "It took too long, or it was opened in another browser. Please try again.", retry: true },
|
||||
ACCOUNTS_UNAVAILABLE: { title: "Sign-in isn’t available right now", text: "We couldn’t reach the church’s sign-in. Please try again in a minute.", retry: true },
|
||||
START_FAILED: { title: "Sign-in isn’t available right now", text: "Please try again in a minute.", retry: true },
|
||||
FINISH_FAILED: { title: "We couldn’t finish signing you in", text: "Please try again.", retry: true },
|
||||
EVENTS_OFF: { title: "Your access to events is turned off", text: "Your church account is fine, but you can’t use this site at the moment. Please ask the church office." },
|
||||
MFA_REQUIRED: { title: "Two-step sign-in is needed", text: "Your role here needs a second step when you sign in. Please try again and set it up when asked.", retry: true },
|
||||
EMAIL_IN_USE: { title: "That email address belongs to someone else here", text: "Please ask the church office to sort it out." },
|
||||
EMAIL_NOT_VERIFIED: { title: "Please confirm your email address", text: "Confirm the email address on your church account, then sign in again.", retry: true },
|
||||
};
|
||||
|
||||
function Problem() {
|
||||
const search = useSearchParams();
|
||||
const m = MESSAGES[search.get("code") || ""] ?? { title: "Something went wrong signing in", text: "Please try again.", retry: true };
|
||||
return (
|
||||
<div className="w-full max-w-md border rounded-2xl p-8 bg-white shadow-sm">
|
||||
<h1 className="text-xl font-semibold text-gray-900 mb-2">{m.title}</h1>
|
||||
<p className="text-sm text-gray-600 mb-6">{m.text}</p>
|
||||
{m.retry && <a href={signInHref(safePath(search.get("returnTo"), "/"))} className="inline-block w-full text-center px-4 py-2.5 rounded-lg bg-brand-600 text-white text-sm font-medium">Try again</a>}
|
||||
<a href="/" className="block mt-3 text-center text-sm text-gray-500 underline">Home page</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function SignInProblemPage() {
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
<Navbar />
|
||||
<main className="flex-1 flex items-center justify-center p-6">
|
||||
<Suspense fallback={<div />}><Problem /></Suspense>
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import { ApiError, resolveToApiOrigin } from "@/lib/api";
|
||||
import { apiV2Raw, apiV2Data } from "@/lib/apiV2";
|
||||
import { useSiteSettings } from "@/contexts/SiteSettingsContext";
|
||||
import { useDismissingState } from "@/hooks/useDismissingState";
|
||||
import { Building2, Palette, Bell, Mail, Scale, MessageCircle, CreditCard, DatabaseBackup, Timer, KeyRound, MapPinned, type LucideIcon, Webhook, Sparkles, Link2 } from "lucide-react";
|
||||
import { Building2, Palette, Bell, Mail, Scale, MessageCircle, CreditCard, DatabaseBackup, Timer, KeyRound, MapPinned, type LucideIcon, Webhook, Sparkles, Link2, LogIn } from "lucide-react";
|
||||
import { ColorPickerField } from "@/components/admin/ColorPickerField";
|
||||
import { BrandingPreviewPanel } from "@/components/admin/BrandingPreviewPanel";
|
||||
import { BackupsTab } from "@/components/admin/BackupsTab";
|
||||
@@ -18,6 +18,7 @@ import { LicenceTab } from "@/components/admin/LicenceTab";
|
||||
import { WebhooksTab } from "@/components/admin/WebhooksTab";
|
||||
import { AiTab } from "@/components/admin/AiTab";
|
||||
import { LinkedProductsTab } from "@/components/admin/LinkedProductsTab";
|
||||
import { SignInTab } from "@/components/admin/SignInTab";
|
||||
import { CampusesTab } from "@/components/admin/CampusesTab";
|
||||
import { extractDominantColors } from "@/lib/extractColors";
|
||||
import { mapsSearchUrl } from "@/lib/maps";
|
||||
@@ -26,7 +27,7 @@ import { BackLink } from "@/components/shared/BackLink";
|
||||
import { uploadImage } from "@/lib/eventSetup";
|
||||
import { useExternalEffect } from "@/lib/hooks";
|
||||
|
||||
type TabId = "organisation" | "campuses" | "branding" | "notifications" | "email" | "legal" | "whatsapp" | "payments" | "webhooks" | "linked" | "backups" | "jobs" | "licence" | "ai";
|
||||
type TabId = "organisation" | "campuses" | "branding" | "notifications" | "email" | "legal" | "whatsapp" | "payments" | "webhooks" | "linked" | "signin" | "backups" | "jobs" | "licence" | "ai";
|
||||
|
||||
const TABS: { id: TabId; label: string; icon: LucideIcon }[] = [
|
||||
{ id: "organisation", label: "Organisation", icon: Building2 },
|
||||
@@ -39,6 +40,7 @@ const TABS: { id: TabId; label: string; icon: LucideIcon }[] = [
|
||||
{ id: "payments", label: "Payments", icon: CreditCard },
|
||||
{ id: "webhooks", label: "Webhooks", icon: Webhook },
|
||||
{ id: "linked", label: "Linked products", icon: Link2 },
|
||||
{ id: "signin", label: "Sign-in", icon: LogIn },
|
||||
{ id: "backups", label: "Backups", icon: DatabaseBackup },
|
||||
{ id: "jobs", label: "Background jobs", icon: Timer },
|
||||
{ id: "licence", label: "Licence", icon: KeyRound },
|
||||
@@ -721,6 +723,7 @@ function SiteSettingsPageInner() {
|
||||
{activeTab === "backups" && <BackupsTab active={activeTab === "backups"} />}
|
||||
{activeTab === "webhooks" && <WebhooksTab active={activeTab === "webhooks"} />}
|
||||
{activeTab === "linked" && <LinkedProductsTab active={activeTab === "linked"} />}
|
||||
{activeTab === "signin" && <SignInTab active={activeTab === "signin"} />}
|
||||
{activeTab === "jobs" && <JobsTab active={activeTab === "jobs"} />}
|
||||
{activeTab === "licence" && <LicenceTab active={activeTab === "licence"} />}
|
||||
{activeTab === "ai" && <AiTab active={activeTab === "ai"} />}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { useAuthInfo } from "@/components/auth/ChurchAccountNotice";
|
||||
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
@@ -39,6 +40,9 @@ const TWO_FACTOR_LABEL: Record<"email" | "whatsapp" | "authenticator", string> =
|
||||
|
||||
export default function AdminUsersPage() {
|
||||
const { user, loading, token } = useAuth();
|
||||
// 3.0.0: signed in through the church's Accounts, 2FA and lockouts are reset there.
|
||||
const authInfo = useAuthInfo();
|
||||
const viaAccounts = authInfo?.mode === "accounts";
|
||||
const router = useRouter();
|
||||
|
||||
const isAdmin = useMemo(() => user?.role === "admin", [user]);
|
||||
@@ -234,15 +238,25 @@ export default function AdminUsersPage() {
|
||||
const message = role === "admin" || role === "supervisor"
|
||||
? `Reset two-factor authentication for ${name}? Their sessions end, and they'll set it up again with a new code at their next login.`
|
||||
: `Turn off two-factor authentication for ${name}? They will be able to log in with just their password until they turn it back on.`;
|
||||
if (!confirm(message)) return;
|
||||
if (!confirm(viaAccounts ? `Reset two-step sign-in for ${name} on their church account? They're signed out everywhere and set it up again at their next sign-in.` : message)) return;
|
||||
try {
|
||||
await apiV2Data("patch", "/users/{id}", { params: { id: id }, authToken: token, body: { twoFactorEnabled: false } });
|
||||
if (viaAccounts) await apiV2Data("post", "/users/{id}/account/reset-two-factor", { params: { id }, authToken: token });
|
||||
else await apiV2Data("patch", "/users/{id}", { params: { id: id }, authToken: token, body: { twoFactorEnabled: false } });
|
||||
await loadUsers(page);
|
||||
} catch (e) {
|
||||
setError(errorMessage(e) || "Failed to reset two-factor authentication");
|
||||
}
|
||||
};
|
||||
|
||||
const unlockAccount = async (id: string, name: string) => {
|
||||
try {
|
||||
await apiV2Data("post", "/users/{id}/account/unlock", { params: { id }, authToken: token });
|
||||
alert(`${name} can sign in again.`);
|
||||
} catch (e) {
|
||||
setError(errorMessage(e) || "Failed to unlock the account");
|
||||
}
|
||||
};
|
||||
|
||||
const deactivate = async (id: string) => {
|
||||
if (!confirm("Deactivate this user? Their account will be disabled.")) return;
|
||||
try {
|
||||
@@ -447,7 +461,10 @@ export default function AdminUsersPage() {
|
||||
{u.twoFactorEnabled && (
|
||||
<button className="px-2 py-1 text-xs rounded bg-amber-500 text-white hover:bg-amber-600" onClick={() => resetTwoFactor(u.id, u.name, u.role)} title={u.role === "admin" || u.role === "supervisor" ? "Reset two-factor authentication — they set it up again at their next login" : "Turn off two-factor authentication for a user who can no longer receive their codes"}>Reset 2FA</button>
|
||||
)}
|
||||
<button className="px-2 py-1 text-xs rounded bg-orange-500 text-white hover:bg-orange-600" onClick={() => deactivate(u.id)} title="Deactivate account">Deactivate</button>
|
||||
{viaAccounts && (
|
||||
<button className="px-2 py-1 text-xs rounded bg-gray-100 hover:bg-gray-200" onClick={() => unlockAccount(u.id, u.name)} title="After too many wrong passwords: let them try again now">Unlock</button>
|
||||
)}
|
||||
<button className="px-2 py-1 text-xs rounded bg-orange-500 text-white hover:bg-orange-600" onClick={() => deactivate(u.id)} title={viaAccounts ? "Stop them using Cross Events (their church account stays)" : "Deactivate account"}>Deactivate</button>
|
||||
<button className="px-2 py-1 text-xs rounded bg-red-700 text-white hover:bg-red-800" onClick={() => deleteUserData(u.id, u.name)} title="Erase personal data">Delete data</button>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { ChurchAccountNotice, useAuthInfo } from "@/components/auth/ChurchAccountNotice";
|
||||
|
||||
import React, { useCallback, useState } from "react";
|
||||
import Link from "next/link";
|
||||
@@ -77,6 +78,10 @@ function Toggle({ label, hint, checked, disabled, onChange }: { label: string; h
|
||||
|
||||
export default function PrivacyCentrePage() {
|
||||
const { token, logout } = useAuth();
|
||||
// 3.0.0: signed in through the church's Accounts, news choices, "download my data" (with this
|
||||
// site's part in it) and deleting the account are on the church account.
|
||||
const authInfo = useAuthInfo();
|
||||
const viaAccounts = authInfo?.mode === "accounts";
|
||||
const [info, setInfo] = useState<PrivacyInfo | null>(null);
|
||||
const [loadError, setLoadError] = useState<string | null>(null);
|
||||
|
||||
@@ -202,7 +207,14 @@ export default function PrivacyCentrePage() {
|
||||
|
||||
<div className="grid lg:grid-cols-2 gap-6 items-start">
|
||||
<div className="space-y-6">
|
||||
{viaAccounts && (
|
||||
<ChurchAccountNotice
|
||||
accountUrl={authInfo?.accountUrl ?? null}
|
||||
what="Your news choices, downloading everything the church holds about you (including your events, tickets and payments here), and deleting your account are on your church account, for all the church's sites and apps at once."
|
||||
/>
|
||||
)}
|
||||
{/* ── News & announcements ───────────────────────────────────────── */}
|
||||
{!viaAccounts && (<>
|
||||
<section className="border rounded-xl p-5 bg-white shadow-sm">
|
||||
<SectionHeader icon={Megaphone} title="News & announcements" />
|
||||
<p className="text-sm text-gray-500 mb-4">
|
||||
@@ -255,6 +267,7 @@ export default function PrivacyCentrePage() {
|
||||
{downloadMsg && <Alert msg={downloadMsg} />}
|
||||
</section>
|
||||
|
||||
</>)}
|
||||
{/* ── My requests ────────────────────────────────────────────────── */}
|
||||
{info && info.requests.length > 0 && (
|
||||
<section className="border rounded-xl p-5 bg-white shadow-sm">
|
||||
@@ -300,6 +313,7 @@ export default function PrivacyCentrePage() {
|
||||
</section>
|
||||
|
||||
{/* ── Delete my account ──────────────────────────────────────────── */}
|
||||
{!viaAccounts && (
|
||||
<section className="border border-red-200 rounded-xl p-5 bg-white shadow-sm">
|
||||
<SectionHeader icon={Trash2} title="Delete my account" tone="red" />
|
||||
<p className="text-sm text-gray-500 mb-4">
|
||||
@@ -337,6 +351,7 @@ export default function PrivacyCentrePage() {
|
||||
)}
|
||||
{deleteMsg && <Alert msg={deleteMsg} />}
|
||||
</section>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { ChurchAccountNotice, useAuthInfo } from "@/components/auth/ChurchAccountNotice";
|
||||
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
@@ -50,6 +51,10 @@ const SectionHeader = ({ icon: Icon, title, tone = "brand" }: { icon: typeof Use
|
||||
export default function UserProfilePage() {
|
||||
const { user, token, logout, updateToken } = useAuth();
|
||||
const router = useRouter();
|
||||
// 3.0.0: signed in through the church's Accounts, the details, password, two-step sign-in and
|
||||
// closing the account are on the church account.
|
||||
const authInfo = useAuthInfo();
|
||||
const viaAccounts = authInfo?.mode === "accounts";
|
||||
|
||||
useEffect(() => {
|
||||
if (!user && !token) router.replace("/login");
|
||||
@@ -372,16 +377,21 @@ export default function UserProfilePage() {
|
||||
<form onSubmit={saveProfile} className="space-y-4">
|
||||
<div>
|
||||
<label htmlFor="profile-full-name" className="block text-sm font-medium text-gray-700 mb-1">Full name</label>
|
||||
<input id="profile-full-name" className={inputCls} value={name} onChange={e => setName(e.target.value)} required />
|
||||
<input id="profile-full-name" className={inputCls} value={name} onChange={e => setName(e.target.value)} required readOnly={viaAccounts} />
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="profile-email-address" className="block text-sm font-medium text-gray-700 mb-1">Email address</label>
|
||||
<input id="profile-email-address" type="email" className={inputCls} value={email} onChange={e => setEmail(e.target.value)} required />
|
||||
<input id="profile-email-address" type="email" className={inputCls} value={email} onChange={e => setEmail(e.target.value)} required readOnly={viaAccounts} />
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="profile-phone-number" className="block text-sm font-medium text-gray-700 mb-1">Phone number</label>
|
||||
<input id="profile-phone-number" type="tel" className={inputCls} value={phone} onChange={e => setPhone(e.target.value)} placeholder="e.g. 082 123 4567" />
|
||||
<input id="profile-phone-number" type="tel" className={inputCls} value={phone} onChange={e => setPhone(e.target.value)} placeholder="e.g. 082 123 4567" readOnly={viaAccounts} />
|
||||
</div>
|
||||
{viaAccounts && (
|
||||
<p className="text-xs text-gray-500">
|
||||
Your name, email and phone are on your church account{authInfo?.accountUrl ? <>: <a href={authInfo.accountUrl} className="text-brand-600 hover:underline">change them there</a></> : null}. Changes show here the next time you sign in.
|
||||
</p>
|
||||
)}
|
||||
|
||||
{campusInfo.enabled && campusInfo.campuses.length > 0 && (
|
||||
<div>
|
||||
@@ -443,6 +453,13 @@ export default function UserProfilePage() {
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">
|
||||
{viaAccounts && (
|
||||
<ChurchAccountNotice
|
||||
accountUrl={authInfo?.accountUrl ?? null}
|
||||
what="Your password, two-step sign-in, recovery codes, recent sign-ins and closing your account are on your church account, the same one you use for the church's other sites and apps."
|
||||
/>
|
||||
)}
|
||||
{!viaAccounts && (<>
|
||||
{/* ── Password ─────────────────────────────────────────────────── */}
|
||||
<section className="border rounded-xl p-5 bg-white shadow-sm">
|
||||
<SectionHeader icon={Lock} title="Change password" />
|
||||
@@ -706,6 +723,7 @@ export default function UserProfilePage() {
|
||||
</form>
|
||||
)}
|
||||
</section>
|
||||
</>)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
import { AccountsGate } from "@/components/auth/AccountsGate";
|
||||
import React, { Suspense, useMemo, useState } from "react";
|
||||
import { Navbar } from "@/components/layout/Navbar";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
@@ -68,10 +69,15 @@ function ResetPasswordContent() {
|
||||
);
|
||||
}
|
||||
|
||||
export default function ResetPasswordPage() {
|
||||
function ResetPasswordPageLocal() {
|
||||
return (
|
||||
<Suspense fallback={<div className="p-6">Loading...</div>}>
|
||||
<ResetPasswordContent />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
// 3.0.0: forwards to the church's Accounts once sign-in has moved there (components/auth/AccountsGate).
|
||||
export default function ResetPasswordPage() {
|
||||
return <AccountsGate kind="reset"><ResetPasswordPageLocal /></AccountsGate>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user