I added Microsoft Auth to my Next.js app in 5 minutes. Here's how.
No, seriously. One command. npx @chemmangat/msal-next-cli init That's it. It asks you three questions, writes your .env.local, wires up layout.tsx, and creates a starter auth page. You didn't misre...

Source: DEV Community
No, seriously. One command. npx @chemmangat/msal-next-cli init That's it. It asks you three questions, writes your .env.local, wires up layout.tsx, and creates a starter auth page. You didn't misread that. The problem with MSAL in Next.js If you've tried it before, you know. The official docs are verbose. Middleware breaks on the edge runtime. Token expiry is hardcoded. Cookie sync is manual. And MSAL v5 just dropped with enough breaking changes to ruin your afternoon. @chemmangat/msal-next fixes all of that. What v5.3.0 ships Auto cookie sync — MsalAuthProvider now writes and clears msal.account on every login/logout automatically. Middleware works with zero manual setup. Edge runtime fixed — createAuthMiddleware now lives in its own import path, no more Next.js edge crashes. Real token expiry — reads actual expiresOn from the token. No more hardcoded 3600 seconds sneaking up on you in prod. MSAL v3, v4, v5 all supported — runtime version detection. You update MSAL, nothing breaks. Th