fix(auth): update backend URL and API endpoint for authentication

This commit is contained in:
Nils-Johan Gynther
2026-04-17 20:05:18 +02:00
parent 7afa1ee3c4
commit 06438b77e5
2 changed files with 2 additions and 83 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import NextAuth from 'next-auth';
import Credentials from 'next-auth/providers/credentials';
const BACKEND_URL = process.env.NEXT_PUBLIC_API_URL ?? 'http://recipe-api:3000/api';
const BACKEND_URL = process.env.NEXT_PUBLIC_API_URL_INTERNAL ?? 'http://recipe-api:8080';
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [
@@ -13,7 +13,7 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
async authorize(credentials) {
if (!credentials?.username || !credentials?.password) return null;
try {
const res = await fetch(`${BACKEND_URL}/auth/login`, {
const res = await fetch(`${BACKEND_URL}/api/auth/login`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({