All of my actions fail, though they work fine in Postman. I get a 500 everytime.
This is my server action:
async function getUser(formData: FormData) {
"use server";
const cookieStore = cookies();
const token = cookieStore.get("token");
const username = formData?.get("username"); // Test username: 9098745
const res = await fetch(`${process.env.IMIS_URL}/api/User/${username}`, {
method: "GET",
headers: {
Authorization: `Bearer ${token?.value}`,
},
});
const data = await res.json();
console.log("🚀 ~ data:", data);
}
And the error I get:
at async $$ACTION_0 (confirm-your-account/page.tsx:83:17)
Cause: Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1550:34)
at TLSSocket.emit (node:events:514:28)
at TLSSocket._finishInit (node:_tls_wrap:967:8)
at ssl.onhandshakedone (node:_tls_wrap:743:12)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
}```