Next.js Discord

Discord Forum

Problems with "Learn Next" official tutorial Chapter 15: Adding Authentication

Answered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
So I've worked through [the authentication portion of the official tutorial](https://nextjs.org/learn/dashboard-app/adding-authentication), but I can't actually log in! In the course of debugging, I added a console log to the catch block in the authenticate function in /app/lib/actions.ts, which is producing an error with this digest: NEXT_REDIRECT;replace;http://localhost:3001/login;false.

I cloned the [official finished project](https://github.com/vercel/next-learn) and ran it locally, and auth works fine there. After that I copy-pasted everything from every file I touched in chapter 15 from the official repo into my project, which is [here](https://github.com/ngm01/nextjs-dashboard). Still no luck, still getting the NEXT_REDIRECT error. I'm kind of beating my head against the wall at this point. I'd appreciate any insight anyone could offer on this. Thanks!

(Other gleanings from my console bombing that may be helpful: the call to getUser in auth.ts is successful, I can log the user object the the console. However the auth object that's being checked for a user property in auth.config.ts is always null, and thus isLoggedIn in that file is always false.)
Answered by Cape lion
In case anyone stumbles on this post having the same issue, I resolved it by updating the next version in my project from 14.0.0 to latest (in my case that was 14.0.3, but 14.0.2 in the official repo worked as well.)
View full answer

1 Reply

Cape lionOP
In case anyone stumbles on this post having the same issue, I resolved it by updating the next version in my project from 14.0.0 to latest (in my case that was 14.0.3, but 14.0.2 in the official repo worked as well.)
Answer