WaspW
Wasp2y ago
Harish

Preserving Query Parameters in Google Social Auth Redirects

I'm currently integrating Google Social Auth into our application. In certain instances, our login URLs contain query parameters. After users successfully authenticate through Google, we need to ensure that any query parameters from the original URL persist in the redirect URL.

For instance, if a user clicks on the following link without an active login session:

https://my-application/chat?message=hello

The user is redirected to Google auth. Upon successful authentication, they're redirected back to:

https://my-application/chat (because of onAuthSucceededRedirectTo: "/chat" in the
main.wasp
)

However, i would it to redirected back to:

https://my-application/chat?message=hello

How can we configure this behaviour in WASP?
Was this page helpful?