fix: cors

This commit is contained in:
2026-06-06 09:31:31 +05:30
parent 1789fc0abe
commit cb81d476a8
3 changed files with 23 additions and 18 deletions

View File

@@ -9,7 +9,7 @@ export function AuthProvider({ children }) {
const verifyToken = useCallback(async (tkn) => {
try {
const res = await fetch('http://localhost:5000/api/verify-token', {
const res = await fetch('/api/verify-token', {
headers: { 'Authorization': `Bearer ${tkn}` }
});
if (res.ok) {
@@ -42,7 +42,7 @@ export function AuthProvider({ children }) {
const login = async (email, password) => {
try {
const res = await fetch('http://localhost:5000/api/login', {
const res = await fetch('/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password })
@@ -61,7 +61,7 @@ export function AuthProvider({ children }) {
const register = async (username, email, password) => {
try {
const res = await fetch('http://localhost:5000/api/register', {
const res = await fetch('/api/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, email, password })