sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 126 forks source link

Behavior differs between `sst dev` and `sst deploy` (Ion auth handler using GoogleAdapter) #555

Open madisonbullard opened 2 weeks ago

madisonbullard commented 2 weeks ago

I can't get a response body from an auth handler Function when running sst dev, but it behaves as expected after sst deploy.

I created a repo to demonstrate this issue: https://github.com/madisonbullard/sst-ion-auth-issue

Details included in the README, referenced here:

In this repo, I'm creating an auth flow that should (I think) work for Google OIDC. The deployed SST app works as expected, but the sst dev behavior differs in unexpected ways.

Expected result: A 200 response, with a JSON body detailing a 302 redirect Observed result: A 200 response, but no response body

The CloudWatch logs (see the sanitized logs in cloudwatch_logs.txt) show that when running sst dev and hitting the endpoint, the auth handler Lambda function is receiving the correct message (the JSON body with the 302 info).

We can actually view the expected result if we sst deploy instead of sst dev