create-vite-react-boot 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apply.js +0 -12
- package/package.json +1 -1
package/lib/apply.js
CHANGED
@@ -286,18 +286,6 @@ export function useAuth() {
|
|
286
286
|
if (!ctx) throw new Error('useAuth must be used within AuthProvider')
|
287
287
|
return ctx
|
288
288
|
}
|
289
|
-
|
290
|
-
`,
|
291
|
-
axiosClient: `import axios from 'axios'
|
292
|
-
export const api = axios.create({ baseURL: '/api', timeout: 8000 })
|
293
|
-
api.interceptors.request.use(cfg=>{
|
294
|
-
const raw = localStorage.getItem('session_v1')
|
295
|
-
if(raw){
|
296
|
-
const token = (JSON.parse(raw) as { id:string }).id
|
297
|
-
cfg.headers.Authorization = 'Bearer ' + token
|
298
|
-
}
|
299
|
-
return cfg
|
300
|
-
})
|
301
289
|
`,
|
302
290
|
axiosAuthApi: `import { api } from './client'
|
303
291
|
type Session = { id:string; email:string; name:string }
|