mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-26 19:26:33 +00:00
Address code review feedback - persistent dev secrets and fix empty auth header
Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com>
This commit is contained in:
@@ -73,10 +73,13 @@ export default function AdminDashboard() {
|
||||
// Helper function to get authorization headers
|
||||
const getAuthHeaders = (): Record<string, string> => {
|
||||
const token = getAdminToken()
|
||||
return {
|
||||
'Authorization': token ? `Bearer ${token}` : '',
|
||||
const headers: Record<string, string> = {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
if (token) {
|
||||
headers['Authorization'] = `Bearer ${token}`
|
||||
}
|
||||
return headers
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user