Skip to content

Commit 1cf177f

Browse files
feat(swingset): add live password editing demo
1 parent 89b92ba commit 1cf177f

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

‎packages/swingset/src/app/(clerk)/live-sidebar.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from '@/components/ui/sidebar';
2020

2121
const flows = [
22+
{ title: 'Password', href: '/live/password' },
2223
{ title: 'Delete account', href: '/live/delete-account' },
2324
{ title: 'Reverification', href: '/live/reverification' },
2425
];
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
'use client';
2+
3+
import { UserProfilePasswordSection } from '@clerk/mosaic/features/user-profile/user-profile-password-section/user-profile-password-section';
4+
import { MosaicProvider } from '@clerk/mosaic/MosaicProvider';
5+
import { useUser } from '@clerk/nextjs';
6+
import Link from 'next/link';
7+
8+
export default function PasswordLivePage() {
9+
const { isLoaded, isSignedIn } = useUser();
10+
11+
return (
12+
<MosaicProvider>
13+
<div className='mx-auto flex w-full max-w-3xl flex-col gap-6 p-3 sm:p-8'>
14+
<div className='flex flex-col gap-1'>
15+
<h1 className='text-xl font-semibold'>Password</h1>
16+
<p className='text-muted-foreground text-sm'>Set or change the password for your signed-in account.</p>
17+
</div>
18+
{!isLoaded ? <p className='text-muted-foreground text-sm'>Loading…</p> : null}
19+
{isLoaded && !isSignedIn ? (
20+
<p className='text-muted-foreground text-sm'>
21+
<Link
22+
href='/sign-in'
23+
className='text-foreground underline underline-offset-4'
24+
>
25+
Sign in
26+
</Link>{' '}
27+
to manage your password.
28+
</p>
29+
) : null}
30+
{isLoaded && isSignedIn ? <UserProfilePasswordSection /> : null}
31+
</div>
32+
</MosaicProvider>
33+
);
34+
}

0 commit comments

Comments
 (0)