i am trying to implement Chat engine to my website but when trying to access the chat engine api i get --CORS No Allow Credentials-- "Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’ "
chat.js
import { ChatEngine } from 'react-chat-engine';
import React from 'react';
import LoginForm from './components/LoginForm.jsx'
import './chat.css';
const projectID = 'projectID ';
const chat = () => {
if (!localStorage.getItem('username')) return <LoginForm />;
return (
<ChatEngine
height="100vh"
projectID={projectID}
userName={localStorage.getItem('username')}
userSecret={localStorage.getItem('password')}
/>
);
};
export default chat;
at first i couldn't even login and was getting the same error but i fixed it by adding withCredentials: false
to the axios.post