Skip to content

Commit

Permalink
fix: do jar management correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyArt1 committed Feb 6, 2025
1 parent e708dd5 commit 48fb5be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/app/[lang]/account-created/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ import styles from './page.module.css';

import { GridContainer, GridItem } from '@/components/elements/grid';
import { TextBody } from '@/components/elements/typography';
import { getCookie, removeCookie } from '@/actions';
import { getDictionary } from '@/dictionaries';
import { CitizenCookie } from '@/types';
import { Locale } from '@/i18n-config';
import { getCookie } from '@/actions';

type Props = { params: Promise<{ lang: Locale }> };

export default async function ConfirmationPage({ params }: Props) {
const citizen = await getCookie<CitizenCookie>('citizen');
const intl = await getDictionary((await params).lang);
removeCookie('citizen');

const sites = [
{
Expand Down
4 changes: 1 addition & 3 deletions src/app/[lang]/register/register.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { RegistrationFlow, VerificationFlow } from '@ory/client';
import { redirect } from 'next/navigation';

import { findCitizen, findIamCitizen, removeCookie } from '@/actions';
import { findCitizen, findIamCitizen } from '@/actions';
import { createSearchParams } from '@/common/helpers';
import { ory } from '@/common/lib/ory';
import { State } from '@/types';
Expand Down Expand Up @@ -123,8 +123,6 @@ export async function registerAccount(
return_to: String(form.get('return_to')),
});

removeCookie('_sid');
removeCookie('citizen');
redirect(`../verification?${search}`);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/app/[lang]/verification/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { redirect } from 'next/navigation';
import { z } from 'zod';

import { createSearchParams } from '@/common/helpers';
import { removeCookie } from '@/actions';
import { ory } from '@/common/lib/ory';
import { Form } from './form';

Expand All @@ -12,6 +13,7 @@ type Props = {
export default async function VerificationPage({ searchParams }: Props) {
const { flow, returnTo, code } = await searchParams;
const validated = z.string().length(6).safeParse(code);
removeCookie('_sid');

if (code && validated.data !== code) {
const search = createSearchParams({
Expand Down

0 comments on commit 48fb5be

Please sign in to comment.