Facing issue while login into Medplum on Ec2 insta...
# support
u
I am using Medplum and added some new futures according to my use case. Everything is working as expected in my local. Still, when I deployed my application on EC2 (self-hosting) and tried to login into the system I got an error (Cannot read properties of undefined (reading 'digest')). I have verified this in other machines and things are working as expected. I am attaching SS for reference. 1. I even replaced the EC2 IP address in the .env file 2. Verify the existence of the email and password in the database 3. npm run build:all was also successful Can you please help me with the potential issue? Thank you. @reshma @rahul1
@rahul1 @reshma Any comment from your side? Thanks
c
Hi Usama - this is a tricky case. You're experiencing a client-side error. The client side crypto features (such as SubtleCrypto.digest) are only available in "secure contexts". Typically, that means HTTPS. Browser developers made a special case for "localhost", for local development. But it won't work for HTTP when hitting an IP address, like you're doing in the screenshot. So, in practice, that means putting an HTTP/SSL certificate in front of your server. For your local development, you can disable this in Google Chrome: https://stackoverflow.com/a/75738657 Learn more about secure contexts here: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest
184 Views