user creation and invites
This commit is contained in:
12
app/(public)/invite/accept/page.tsx
Normal file
12
app/(public)/invite/accept/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { verifyInvite } from '@/lib/invite';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export default async function AcceptInvitePage({ searchParams }: { searchParams: { token?: string } }) {
|
||||
const invite = searchParams.token ? await verifyInvite(searchParams.token) : null
|
||||
|
||||
if (!invite || invite.accepted || new Date(invite.expiresAt) < new Date()) {
|
||||
return <div className='text-center mt-10'>Invalid or expired invitation.</div>
|
||||
}
|
||||
|
||||
redirect(`/signup?token=${invite.token}`)
|
||||
}
|
||||
Reference in New Issue
Block a user