fix: cors
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user