COACH
KKinde
•Created by COACH on 1/4/2025 in #💻┃support
Netlify functions, Web Crypto API (crypto.subtle), set AWS_LAMBDA_JS_RUNTIME to nodejs20.x
I am not posting this as a support request, but to help anyone else in the future.
I was having the following issue...
TypeError: Cannot read properties of undefined (reading 'subtle')
at Object.<anonymous> (/var/task/node_modules/@kinde-oss/kinde-node-express/dist/index.cjs:63:237212)
at Module._compile (node:internal/modules/cjs/loader:1364:14) ...
This error occurs because the Kinde SDK is trying to access the Web Crypto API (crypto.subtle), this is only available in nodejs19.x, and Netlify defaults to nodejs18.x.
https://docs.netlify.com/functions/optional-configuration/?fn-language=js#node-js-version-for-runtime-22 replies
KKinde
•Created by COACH on 12/28/2024 in #💻┃support
ExpressJS SDK working locally, but not hosted, need help with logging
I have run various versions of my kinde-node-express app locally, and authentication and role-based access work fine, allowing me to protect directory paths based on roles.
I tried publishing to vercel first, and then tried fly.io, and still not working as it did locally. I have checked (e.g., running "printenv" fly.io console) and all URLs are correct, so it is not that.
Currently running on fly.io, all my directory paths are protected from access. Accessing "/login" does send me correctly to kinde.com for login and I get the auth code, which I enter but am then redirected to my "unAuthorisedUrl" rather than being able to access the directory paths as I can locally.
I have tried multiple ways to figure out how to log what could be going wrong, but I just can't figure out where to add logging to determine what is different between local and hosted versions.
For example I can't see any logging output in my "kindeMiddleware" class. I can see this data when someone is authenticated. So it seems to be an authentication issue when hosted.
Here is my gist: https://gist.github.com/mashdot/b34cd688b4d95e13fd39191b001cd872
7 replies
KKinde
•Created by COACH on 12/15/2024 in #💻┃support
Any way to continually test service without waiting for email code?
I am using kinde with expressjs and having trouble with routes. Whilst testing I have to keep requesting email auth code, is there a way I can set single code, or disable the need to confirm?
4 replies
KKinde
•Created by COACH on 11/24/2024 in #💻┃support
expressjs and protected routes with user roles
I am trying to find an example online of using express SDK and protecting routes for users with given roles.
Is there anything out there?
3 replies