first iteration on frontend, done by claude because i'm lazy with frontend

This commit is contained in:
2026-05-20 12:02:51 -06:00
parent 887ad1e981
commit 64efed0809
49 changed files with 11864 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import axios from 'axios'
const client = axios.create({
baseURL: '/api',
headers: { 'Content-Type': 'application/json' },
})
client.interceptors.request.use((config) => {
const token = localStorage.getItem('token')
if (token) config.headers.Authorization = `Bearer ${token}`
return config
})
client.interceptors.response.use(
(res) => res,
(err) => {
if (err.response?.status === 401) {
localStorage.removeItem('token')
window.location.href = '/login'
}
return Promise.reject(err)
}
)
export default client