Using next-auth with next-intl
Answered
tayshin.gg posted this in #help-forum
Hello everyone 👋
I'm currently working on a Next.js project and I'm having trouble with one thing. I'm trying to use two middlewares:
Has anyone had experience with this or know of a way to make this work? Any help would be greatly appreciated!
I'm currently working on a Next.js project and I'm having trouble with one thing. I'm trying to use two middlewares:
withAuth from next-auth and createMiddleware from next-intl. However, I'm having difficulty integrating them into a single middleware.ts file at the root of my project.Has anyone had experience with this or know of a way to make this work? Any help would be greatly appreciated!
Answered by not-milo.tsx
Have you tried the approach described in
https://next-intl-docs.vercel.app/docs/routing/middleware
next-intl's documentation?https://next-intl-docs.vercel.app/docs/routing/middleware
5 Replies
Have you tried the approach described in
https://next-intl-docs.vercel.app/docs/routing/middleware
next-intl's documentation?https://next-intl-docs.vercel.app/docs/routing/middleware
Answer
Towards the end of the page they talk specifically about integrating both packages in middleware
@tayshin.gg did you manage to do it?
Oh sorry I didn’t see your message, yes after a few research on the discord and the documentation, I’ve managed to make it work using the exemple with next-auth of next-intl documentation!
@not-milo.tsx Have you tried the approach described in `next-intl`'s documentation?
<https://next-intl-docs.vercel.app/docs/routing/middleware>
Great! I'm glad to hear that ✌ðŸ»
You can mark it resolved by right-clicking on this message and selecting "Mark Resolution" in the apps
You can mark it resolved by right-clicking on this message and selecting "Mark Resolution" in the apps