We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e9c1fb commit 35b4b88Copy full SHA for 35b4b88
src/api/api-client.ts
@@ -0,0 +1,18 @@
1
+import axios, { AxiosResponse } from 'axios'
2
+import {auth} from '@/app/api/auth/[...nextauth]/route'
3
+
4
+export const getBearerToken = async () => {
5
+ const session = await auth()
6
7
+ return `Bearer ${session?.accessToken}`
8
+}
9
10
+const api = axios.create({
11
+ baseURL: process.env.BACKEND_API_URL,
12
+ // headers: {
13
+ // 'Authorization': await getBearerToken(),
14
+ // },
15
+})
16
+api.defaults.headers.common['Content-Type'] = 'application/json'
17
18
+export { api }
0 commit comments