nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
25.12k stars 3.56k forks source link

Adding Next-Auth with ADB2C Fails #12341

Open anandlingaraj opened 16 hours ago

anandlingaraj commented 16 hours ago

Environment


  System:
    OS: macOS 14.6.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 82.34 GB / 128.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.9.0 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.3 - /opt/homebrew/bin/npm
    pnpm: 9.9.0 - /opt/homebrew/bin/pnpm
    Watchman: 2024.10.28.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 131.0.6778.87
    Edge: 131.0.2903.70
    Safari: 17.6
  npmPackages:
    next: ^15.0.3 => 15.0.3 
    next-auth: ^4.24.10 => 4.24.10 
    react: ^18.3.1 => 18.3.1 

Reproduction URL

https://github.com/anandlingaraj/nexty

Describe the issue

Unable to add NextAuth with ADB2C. > rev@0.1.0 dev

next dev

▲ Next.js 15.0.3

How to reproduce

Just Cant start the app at all after adding authentication.

Expected behavior

Expected to redirect to login page.

anandlingaraj commented 16 hours ago

I get TypeError: Cannot read properties of undefined (reading 'substring') at (file:///Users/anandl/projects/chatty/rev/node_modules/oidc-token-hash/lib/shake256.js:3) at eval (webpack-internal:///(middleware)/./node_modules/oidc-token-hash/lib/shake256.js:3:40) at (middleware)/./node_modules/oidc-token-hash/lib/shake256.js (file:///Users/anandl/projects/chatty/rev/.next/server/middleware.js:1500:1) at webpack_require (file:///Users/anandl/projects/chatty/rev/.next/server/edge-runtime-webpack.js:37:33) at fn (file:///Users/anandl/projects/chatty/rev/.next/server/edge-runtime-webpack.js:273:21) at eval (webpack-internal:///(middleware)/./node_modules/oidc-token-hash/lib/index.js:6:18) at (middleware)/./node_modules/oidc-token-hash/lib/index.js (file:///Users/anandl/projects/chatty/rev/.next/server/middleware.js:1490:1) at webpack_require (file:///Users/anandl/projects/chatty/rev/.next/server/edge-runtime-webpack.js:37:33) at fn (file:///Users/anandl/projects/chatty/rev/.next/server/edge-runtime-webpack.js:273:21) at eval (webpack-internal:///(middleware)/./node_modules/openid-client/lib/client.js:11:19) at (middleware)/./node_modules/openid-client/lib/client.js (file:///Users/anandl/projects/chatty/rev/.next/server/middleware.js:1511:1)