0

I used to develop a website that fetches data with kerberos authentication. Unfortunately, when we used react as a frontend framework and tried to implement this code https://github.com/jlguenego/react-sso-example. we could not run it. Firstly, we tried the code provided in the example as it is, but no hope, after that we tried npm audit fix and it managed to get the website working, but when we click "Connect with SSO" button, this error pops up in the console caught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

ANy solution for this error "Unexpected token '<', "<!DOCTYPE "... is not valid JSON"

1 Answers1

0

The error Unexpected token '<', "<!DOCTYPE "... is not valid JSON is a result of the sample project being built to serve as static content to the nodejs express server as seen here
So it won't work with the provided backend when you run it in the development server (npm run start)

To run the sample project. After running the audit fix, Run npm run build

The build will be available in the /build folder.

Restart the backend server and the sample project will be available on the backend port (localhost:3500).

Sagar Darekar
  • 982
  • 9
  • 14
DarkEarl
  • 1
  • 1