Closed romankurnovskii closed 1 year ago
Hi @romankurnovskii I can't reproduce this.
I did:
npx create-react-app my-app
npm i aws-jwt-verify
npm start
and npm run build
All works fine.Might be a versions thing. Perhaps clear your npx
cache and run create-react-app again?
// App.js
import logo from "./logo.svg";
import "./App.css";
import { CognitoJwtVerifier } from "aws-jwt-verify"; // added
// added:
const verifier = CognitoJwtVerifier.create({
userPoolId: "<user pool id>",
clientId: "<client id>",
tokenUse: "access"
});
function App() {
console.log(verifier); // added, just a dummy usage
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}
export default App;
Closing for now, let us know if the issue persists.
I'm facing the same issue while decoding the jwt-id-token
on FE.
I have solved it (temporarily) using this.
JSON.parse(atob(token.split(".")[1]))
Question Facing an issue using react
Versions
aws-jwt-verify
version: 3.1.0npx create-react-app my-app