Replies: 1 comment
-
Aight! Nevermind, I think I got it. The .get(
"/login/google/callback",
async (ctx) => {
return await googleCallback({
code: ctx.query.code,
state: ctx.query.state,
storedState: ctx.cookie.google_oauth_state.value,
storedCodeVerifier: ctx.cookie.google_oauth_codeverifier.value,
});
},
{
query: t.Object(
{
code: t.String(),
state: t.String(),
},
{
/** So we can allow unexpected properties without causing an error. */
additionalProperties: true,
}
),
cookie: t.Cookie({
google_oauth_state: t.String(),
google_oauth_codeverifier: t.String(),
}),
detail: {
description: "Callback for Google OAuth",
tags: ["Auth"],
},
}
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently building OAuth with Lucia, but this blocker I'm facing is Elysia-specific. I am making the /callback endpoint for my OAuth flow currently.
The only query parameters important to me are
code
andstate
from Google OAuth.So, I defined them like this in my query schema:
The errors are:
scope
,authuser
,prompt
are unexpected properties (hence you see 3 errors in the screenshot).To be honest, I don't even need to use them. Is there any way I can define them in typebox in such a way where I don't need to define them.
The workaround currently is to uncommenting these to make the endpoint work but I'd rather not always keep track of what new query variable Google adds to their OAuth callback.
Error
Beta Was this translation helpful? Give feedback.
All reactions