middleware icon indicating copy to clipboard operation
middleware copied to clipboard

Custom redirect uri for @hono/oauth-providers/google

Open amit-saxena opened this issue 1 year ago • 2 comments

I am using @hono/oauth-providers/google, behind a reverse proxy and could not set custom redirect uri. Since, Open Auth handles the redirect uri internally.

amit-saxena avatar Jun 24 '24 17:06 amit-saxena

@amit-saxena you can accomplish this by passing your own redirect_to in the "state" object. The state will be returned to you as query parameters and from there you can do with it whatever you need. In my scenario I am using Oauth in a WordPress plugin and didn't want to register every domain where the plugin was interacting with my API. See my pull request https://github.com/honojs/middleware/pull/454 that was merged in order to accomplish this.

I see this was a few weeks ago so hopefully you weren't stuck

aaronware avatar Jul 05 '24 22:07 aaronware

Thank you @aaronware this is useful.

amit-saxena avatar Jul 06 '24 10:07 amit-saxena