feat(FE) : json role

This commit is contained in:
Yusron alamsyah
2026-02-18 08:21:58 +07:00
parent 6c6b842d3b
commit 466dc076c3
29 changed files with 1539 additions and 172 deletions

No files matched your search

+7 -4
View File
@@ -17,10 +17,13 @@ const apiGomed = axios.create({
// Shared request interceptor
const requestInterceptor = (config: any) => {
const token = localStorage.getItem('token')
if (token) {
config.headers.Authorization = `Bearer ${token}`
// Only access localStorage on client-side (avoid SSR errors)
if (process.client) {
const idToken = localStorage.getItem('idToken')
if (idToken) {
config.headers.Authorization = `Bearer ${idToken}`
}
}
return config