JWT Token in URL results in 404

I’m currently experiencing an issue where passing a JWT token in the URL results in a 404 or page not found screen. This token is sent to the user in an email and used to mark their account as verified. The requests resolve without an issue locally however on Netlify it seems to 404.

Site:
https://vt.trace.engineering

Token URL:
https://vt.trace.engineering/login?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlNjE5YjkzOWExZDNhMDAxZjNjNjk3MCIsImlhdCI6MTU4MzQ1NTEyM30.QEivtMJSiKlUhlalbAu0HKGpVFcCiOcRjWKJF3dCF3A

In testing I removed the periods within the JWT and it resolves the request however, due to the lack of delineation, token is incorrect. Previously, to resolve this issue while using S3 buckets with Cloudflare, we updated DNS to direct this request back to index.js so the router processes the token correctly.

Currently redirects for vt subdomain are handled via an ALIAS record in Route53

Confused how this fix would carry over to Netlify. Would I need to add a _redirect file or does this issue exist within the Route53 DNS config?

Just noticed that this login page within the app is also resulting in a 404

Netlify: https://vt.trace.engineering/regulator/
v.s.
AWS S3: https://regulator-dev.trace.engineering/regulator/

The code between these two instances is mirrored :thinking:

Following up on this issue if anyone else stumbles upon this thread in the future. After thinking about this for a couple days and looking back over the documentation for custom domain setup I found this section in Redirects section.

I ended up creating the following redirect inside of my netlify.toml

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200
  force = false

The token request now resolves without issue :tada:

1 Like

awesome!! so glad you found that. That’s most likely what we would have suggested :slight_smile:

1 Like