refactor API URL handling in TestList and AuthContext components

This commit is contained in:
ishikabhoyar
2025-10-31 15:12:58 +05:30
parent b18dc5f21b
commit abc15efabd
2 changed files with 8 additions and 4 deletions

View File

@@ -41,7 +41,8 @@ export const AuthProvider = ({ children }) => {
// For Google OAuth login
if (googleToken && userInfo) {
// Exchange Google token for our JWT
const response = await fetch('http://localhost:5000/api/students/login', {
const API_URL = import.meta.env.VITE_FACULTY_API_URL || 'http://localhost:5000/api';
const response = await fetch(`${API_URL}/students/login`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',