Next.js Discord

Discord Forum

Vercel Deployment issue

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
I've an app which works find in dev and build locally, but the deployed version isn't.
especially the login and register routes.

7 Replies

Polar bearOP
locally if a user tries to register which doesn't exist and error shows up and inform them, but the deployed version doesn't
my middleware:
Polar bearOP
const verifySession = async (origin: string) => {
    const cookieStore = await cookies();
    const verifyRequest = await fetch(`${origin}/api/auth/verify-session`, {
        headers: { Cookie: cookieStore.toString() },
    });
    const verifySession = (await verifyRequest.json()) as {
        valid: boolean;
        roles: UserRoleEnum[];
    };
    return verifySession;
};
found this in vercel deployment logs
Action error: connect ECONNREFUSED 127.0.0.1:5432
Black Turnstone
can you share where this function is called or what is the value of origin where this function is called?
@Black Turnstone can you share where this function is called or what is the value of origin where this function is called?
Polar bearOP
The issue is resolved.
There was an error in the DATABASE_URL env variable.
The error happens because the login route makes a database query to check if the user exists in the database.