js
js copied to clipboard
bug: crypto is not defined
Describe the bug
I followed the express.js tutorial and when I try to make a call to /logto/sign-in I get the following error
[1] const generateRandomString = (length = 64) => jsBase64.fromUint8Array(crypto.getRandomValues(new Uint8Array(length)), true);
[1] ^
[1]
[1] ReferenceError: crypto is not defined
How to reproduce?
- Create a express backend
- Follow the express.js tutorial
- See the same error as above
Context
- [ ] Logto Cloud
- [x] Self-hosted, Logto version = 1.19.0
- [x] Container (Docker image)
- [ ] Raw Node.js