middleware icon indicating copy to clipboard operation
middleware copied to clipboard

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

Open jacoscaz opened this issue 1 year ago • 2 comments

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?

jacoscaz avatar Nov 12 '24 18:11 jacoscaz

Hi @jacoscaz thank you for raising the issue.

@monoald What do you think of this?

yusukebe avatar Nov 12 '24 19:11 yusukebe

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.

jacoscaz avatar Nov 13 '24 09:11 jacoscaz