honojs / middleware

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

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

Open jacoscaz opened 1 week ago

jacoscaz commented 1 week 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 week ago

Hi @jacoscaz thank you for raising the issue.

@monoald What do you think of this?

jacoscaz commented 1 week 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.