a year ago
[auth][error] UntrustedHost: Host must be trusted. URL was: https://expenserepo.com/api/auth/session. Read more at https://errors.authjs.dev#untrustedhost
at /app/.next/server/src/middleware.js:395:53229
at sA (/app/.next/server/src/middleware.js:395:55929)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2 Replies
a year ago
Smells like CORS.
The "UntrustedHost" error indicates that the host you're trying to connect to is not recognized as a trusted host. To resolve this, you need to add the host to your list of trusted hosts in your application's configuration.
Here's a general approach to fix this:
Identify the Configuration File: Locate the configuration file where your application defines trusted hosts. This is often found in settings or environment configuration files.
Add the Host: Add
expenserepo.comto the list of trusted hosts. This might look something like this in a configuration file:
"trustedHosts": ["expenserepo.com"]Restart Your Application: After making changes, restart your application to apply the new configuration.
For more detailed guidance, you might want to check the documentation specific to the framework or library you're using for authentication. If you need further assistance, feel free to provide more details about your setup.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
I have the variable added but still not work,
NEXTAUTH_TRUST_HOST = true
since i have no problem on localhost, and this never be a issue when I host my domain in AWS Route53.
google API configuration never touched.
I dont even have issue when host it on vercel.
so, this is railway specific issue, please help to look into and give a solution. by going to the variables setting and help figurate out the possible fix
Status changed to Awaiting Railway Response Railway • about 1 year ago