mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-26 19:26:33 +00:00
Fix critical security vulnerabilities - remove hardcoded secrets
Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com>
This commit is contained in:
@@ -15,9 +15,9 @@ export default function AdminLogin() {
|
||||
// Check if already authenticated
|
||||
const checkExistingAuth = async () => {
|
||||
const token = localStorage.getItem('admin_token')
|
||||
if (token === 'admin-secret-key') {
|
||||
if (token) {
|
||||
try {
|
||||
// Verify token with API
|
||||
// Verify token with API - no hardcoded secret check
|
||||
const response = await fetch('http://127.0.0.1:5000/api/admin/courses', {
|
||||
headers: { 'Authorization': `Bearer ${token}` }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user