6 questions
0
votes
0
answers
26
views
Next.js + AWS Amplify Middleware not redirecting after first login until refresh
I am working on a project using Next.js (App Router) and AWS Amplify Auth. I have implemented middleware to restrict access and redirect users based on a custom Cognito attribute (custom:...
0
votes
1
answer
52
views
Middleware is not being triggered
I'm using next-auth with middleware.ts in a Next.js App Router project. Despite putting middleware.ts at the root of the project, it is not being triggered, and protected routes like /profile are ...
0
votes
1
answer
88
views
Secure SPA with dynamic loading using next/dynamic but with *security*
this works really well to do lazy loading to make a performant SPA:
import dynamic from 'next/dynamic';
const DynamicComponents: Record<string, React.ComponentType<ComponentProps<any>>&...
0
votes
1
answer
60
views
Run middleware after request
I have a middleware.ts file defined in my nextjs app. In it I am able to set necessary things like authentication, etc.
I would like to also check the results of my request. I cannot seem to find a ...
0
votes
0
answers
290
views
307 Temporary Redirect (from disk cache)
i am facing an issue in my next js middleware.ts.
this is my config:
middleware.ts
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
import { config as ...
0
votes
0
answers
21
views
Nextjs middleware matcher
So I have a lot of internal i18n URLs and I created a function for generating those URLs.. and then used it in middleware mathcer like this:
export const config = {
matcher: [
'/((?!_next|...