refactor: update authentication flow to use NextAuth, replace better-auth with axios for API calls, and clean up unused code

This commit is contained in:
2025-03-23 15:07:03 +05:00
parent 0fd269df31
commit 020d74c5e2
23 changed files with 1269 additions and 1271 deletions

13
utils/axiosInstance.ts Normal file
View File

@ -0,0 +1,13 @@
import axios from "axios";
axios.defaults.xsrfCookieName = "csrftoken";
axios.defaults.xsrfHeaderName = "X-CSRFToken";
const axiosInstance = axios.create({
baseURL: process.env.NEXT_PUBLIC_API_URL,
validateStatus: (status) => {
return status < 500; // Resolve only if the status code is less than 500
},
});
export default axiosInstance;