mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-02 03:38:22 +00:00
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:
13
utils/axiosInstance.ts
Normal file
13
utils/axiosInstance.ts
Normal 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;
|
Reference in New Issue
Block a user