OAuth Proxy Setup
Hi, I have a question about the OAuth proxy setup.
Accorinding to the docs (https://www.better-auth.com/docs/plugins/oauth-proxy) I should use something like this in
lib/auth.ts
:
But that does not work for me. It results in an error in the master app because after login it redirect to the redirectURI without modifying it. So the oauth proxy on the master app is never used.
After digging through the code a bit, I modified it to this:
and now it works correctly. Alternatively setting the env var BETTER_AUTH_URL
would work, I think.
I also tried with the github social provider instead of the genericOAuth plugin, but same behavior.
Am I misunderstanding something here? Or is the documentation about the oauth proxy plugin just wrong here?
In the latter case, I would be happy to create a PR for it.OAuth Proxy | Better Auth
OAuth Proxy plugin for Better Auth
2 Replies