midnight
Explore posts from serversUnexpected End of JSON Input on API Route
I am working through creating a OIDC workflow. I have a Astro site that sends the user to the Auth endpoint which handles the handshake with Google for Auth and through the
redirect_url
I send the browser back to the SolidStart App.
I have this file at src/routes/auth/callback.ts
that works in dev mode but not when deployed:
Locally on my machine it works just fine but when deployed I get a 500 Request error Unexpected end of JSON input
with the OIDC code in the URL bar: my.domain.com/auth/callback?code=eyJhbGci...
If I pull the code out and put it into jwt.io to validate, its valid and expected. I dont know where to go from here to debug further and would love some guidance on where to investigate and understand where my bug is.32 replies
CDCloudflare Developers
•Created by midnight on 8/20/2024 in #workers-help
Auto Setup Tail Worker with Pulumi for Sentry
Is there a way to automatically setup a tail worker with either Baselime or Sentry when deploying a new worker through Pulumi? We do a per user deployment with SST which leverages the Pulumi provider. I would like to be able to setup a tail worker automatically on deployment for my stages to send logs to either Baselime or Sentry. Is this possible via the API and/or Pulumi versus clickops in the console for each worker?
2 replies
Button to API route returns 404 but direct hit functions
I think I am running into an issue with the router and im 99% sure there is something I am missing.
Im building out an oauth flow. I am able to get the access_token stored as a cookie. I am building the logout flow which is a SolidStart API route that accepts a
GET
request and just deletes the cookie. Hitting the api route with httpie or via curl returns a 302 to the home page as expected but the button that is a href to the same route returns a 404. I am at a loss why the API route can be hit from httpie, works if I manually go to localhost:3000/auth/logout, but not from the button.
I can copy and paste the link the button has and it works, just not when I actually press the button.
Here is the button:
And this is the src/routes/auth/logout.tsx
:
5 replies
JWT to Cookie
I am getting pretty confused on when to use something like
@solid-primitives/storage
versus vinxi/http
to set cookies or if I should use a middleware similar to how sveltekit implements middlewares for locals.
example I am working through is authenticating my user. I have the standard OIDC flow. user clicks the 'login with google' button and is sent to auth.mydomain.com/auth/google/authorize which generates the url sends them to google to signin. The user signs in with google and is send back to auth.mydomain.com/callback/google which validates them in my DB and generates a JWT and sends them back to the location.origin
with the url containing the access_token
. (example: localhost:3000/#eyJhbG....
I want to take that jwt access_token and set it as the Authorization: Bearer $AUTH_TOKEN
and remove the hashed value from the url?
What is the best practice for working with this flow in solidstart? I tried using the useSession
but it requires a password and I dont nececarily need the encryption since I have a helper server side called useSession
that validates the cookie and if anything is wrong, deletes the cookie and returns an error50 replies
CDCloudflare Developers
•Created by midnight on 7/12/2024 in #workers-help
Reset workers subdomain
Is there a way to reset my account’s workers subdomain? We recently closed the business that the subdomain was designated for and we wanted to just reset it back to the default before customization. Is this possible and if so what’s the correct way to proceed?
13 replies