honojs / middleware

monorepo for Hono third-party middleware/helpers/wrappers
https://hono.dev
464 stars 167 forks source link

@hono/oauth-providers: custom state for Facebook auth #823

Open jacoscaz opened 1 day ago

jacoscaz commented 1 day ago

Hello!

I just noticed that the facebookAuth function doesn't support passing custom values for the state param, which is always set to a random value:

https://github.com/honojs/middleware/blob/f997ee0d9a8b857e074d3f12b4db101cfd29d502/packages/oauth-providers/src/providers/facebook/facebookAuth.ts#L18

However, the googleAuth function does allow this:

https://github.com/honojs/middleware/blob/f997ee0d9a8b857e074d3f12b4db101cfd29d502/packages/oauth-providers/src/providers/google/googleAuth.ts#L20

Would you accept a PR that would allow passing custom state values through facebookAuth?

yusukebe commented 1 day ago

Hi @jacoscaz thank you for raising the issue.

@monoald What do you think of this?

jacoscaz commented 18 hours ago

For the time being I'll vendor this package within my own project and test the proposed change. If everything works well I'd be happy to open a PR.