Update Versi 1.5.27 #32

Merged
bagasbanuna merged 1009 commits from staging into main 2025-12-17 12:22:28 +08:00
1672 changed files with 70487 additions and 18716 deletions
Showing only changes of commit e66e365799 - Show all commits

View File

@@ -14,8 +14,7 @@ export async function GET(req: Request) {
console.log("Token received in Cookies:", tokenCookies);
const tokenHeader = req.headers.get("Authorization")?.split(" ")[1];
console.log("Token received in Header:", tokenHeader);
console.log("Token received in Header:", tokenHeader);
if (!tokenCookies) return NextResponse.json({ success: false });
return NextResponse.json({ success: true });

View File

@@ -162,10 +162,11 @@ export const middleware = async (req: NextRequest) => {
}
try {
const originURL = new URL(req.url).origin;
const originURL = process.env.NEXT_PUBLIC_API_URL;
console.log("Origin URL >> ", originURL);
const pathApiValidation = `${new URL(req.url).origin}/api/validation`;
const validationResponse = await fetch(pathApiValidation, {
const apiBaseUrl = process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
const validationResponse = await fetch(`${apiBaseUrl}/api/validation`, {
headers: {
Authorization: `Bearer ${token}`,
},