diff --git a/src/middleware.ts b/src/middleware.ts index 7860ab56..85da6a36 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -85,13 +85,13 @@ const CoHMiddleware = async (request: NextRequest) => { const user = await getUserDetails(); const hasAcceptedCoH = !!user?.codeOfHonorSignDate; - if (!hasAcceptedCoH && !isAcceptHonorPath(request)) { - return redirectWithIntl(request, '/accept-honor'); - } - if ((!user?.studentProfile || hasAcceptedCoH) && isAcceptHonorPath(request)) { return redirectWithIntl(request, '/'); } + + if (!hasAcceptedCoH && !isAcceptHonorPath(request)) { + return redirectWithIntl(request, '/accept-honor'); + } } catch (error) { return null; }