mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-19 19:36:38 +00:00
Its working!
This commit is contained in:
@@ -2,8 +2,17 @@ import axios from "axios";
|
||||
|
||||
// const baseURL = `${window.location.protocol}//${window.location.host}/api/v1`;
|
||||
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: "http://localhost:3000/api/v1",
|
||||
baseURL: "http://testing123.io:8081/api/v1",
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
export const internal = axios.create({
|
||||
baseURL: "http://pangolin:3000/api/v1",
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import api from "@app/api";
|
||||
import { internal } from "@app/api";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export async function verifySession() {
|
||||
const sessionId = cookies().get("session")?.value ?? null;
|
||||
|
||||
try {
|
||||
await api.get("/user", {
|
||||
await internal.get("/user", {
|
||||
headers: {
|
||||
Cookie: `session=${sessionId}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user