1

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

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
adel bouakaz
  • 311
  • 2
  • 11

0 Answers0