Skip to content

Commit

Permalink
chore: use folder with route.ts files
Browse files Browse the repository at this point in the history
  • Loading branch information
rmonnier9 committed Oct 11, 2024
1 parent d925e7d commit 2156a20
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 6 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { logFatalErrorInSentry } from '#utils/sentry';
import { setPathFrom } from '#utils/session';
import withSession from '#utils/session/with-session';
import { NextResponse } from 'next/server';
import { AgentConnectionFailedException } from './callback';
import { AgentConnectionFailedException } from '../callback/route';

export const GET = withSession(async function loginRoute(req) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import logErrorInSentry from '#utils/sentry';
import { cleanAgentSession, cleanPathFrom, getPathFrom } from '#utils/session';
import withSession from '#utils/session/with-session';
import { NextResponse } from 'next/server';
import { LogoutFailedException } from './logout';
import { LogoutFailedException } from '../logout/route';

export const GET = withSession(async function logoutCallbackRoute(req) {
try {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FranceConnectAuthorizeUrl } from '#clients/authentication/france-connec
import { logFatalErrorInSentry } from '#utils/sentry';
import withSession from '#utils/session/with-session';
import { NextResponse } from 'next/server';
import { FranceConnectFailedException } from './callback';
import { FranceConnectFailedException } from '../callback/route';

export const GET = withSession(async function loginRoute(req) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import logErrorInSentry from '#utils/sentry';
import { getPathFrom } from '#utils/session';
import withSession from '#utils/session/with-session';
import { NextResponse } from 'next/server';
import { LogoutFailedException } from './logout';
import { LogoutFailedException } from '../logout/route';

export const GET = withSession(async function logoutCallbackRoute(req) {
try {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions utils/session/with-session.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ISession } from '#models/user/session';
import { IronSession, getIronSession } from 'iron-session';
import { cookies } from 'next/headers';
import { NextRequest, NextResponse } from 'next/server';
import { sessionOptions } from '.';

Expand All @@ -12,8 +13,7 @@ export default function withSession(
return async (req: NextRequest, res: NextResponse) => {
const reqWithSession = req as IReqWithSession;
reqWithSession.session = await getIronSession<ISession>(
req,
res,
cookies(),
sessionOptions
);
return handler(reqWithSession, res);
Expand Down

0 comments on commit 2156a20

Please sign in to comment.