Document generated OAuth endpoints #1704

Closed
opened 2026-03-13 08:57:36 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @ViggoV on GitHub (Aug 14, 2025).

Is this suited for github?

  • Yes, this is suited for github

With integrations like the NextJS one, the endpoints, such as redirect_uri (callback) are obscured by the magic catch all route handler. Since OAuth providers require redirect URIs and so forth it's a frustrating endevour to have to decipher which routes are generated. The documentation have been of very little help.

Image

Describe the solution you'd like

The documentation should really have a clear list of the OAuth route patters generated

Describe alternatives you've considered

I am probably ditching these blackbox libraries for a roll-your-own solution based on the lucia guides

Additional context

No response

Originally created by @ViggoV on GitHub (Aug 14, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. With integrations like the NextJS one, the endpoints, such as redirect_uri (callback) are obscured by the magic catch all route handler. Since OAuth providers require redirect URIs and so forth it's a frustrating endevour to have to decipher which routes are generated. The documentation have been of very little help. <img width="701" height="243" alt="Image" src="https://github.com/user-attachments/assets/0f7fb23a-6f36-4edd-8af6-656d9dc88df2" /> ### Describe the solution you'd like The documentation should really have a clear list of the OAuth route patters generated ### Describe alternatives you've considered I am probably ditching these blackbox libraries for a roll-your-own solution based on the lucia guides ### Additional context _No response_
GiteaMirror added the documentation label 2026-03-13 08:57:36 -05:00
Author
Owner

@SushiiReboot commented on GitHub (Aug 19, 2025):

Hi! It is actually stated in the docs, but to be fair, it’s really easy to miss.
Here is the link for the docs: https://www.better-auth.com/docs/plugins/generic-oauth

There’s a single line in the Generic OAuth section that says:
“The plugin mounts a route to handle the OAuth callback /oauth2/callback/:providerId. This means by default ${baseURL}/api/auth/oauth2/callback/:providerId will be used as the callback URL.”

The problem is that it’s buried in the middle of the configuration section and there’s no example or table showing “this is the redirect URI you need to register”, so it’s not obvious unless you already know what you’re looking for.
Totally agree that a short list/table of the generated OAuth routes (especially the callback/redirect one) would make the docs much clearer and save people time.

@SushiiReboot commented on GitHub (Aug 19, 2025): Hi! **It is** actually stated in the docs, but to be fair, it’s really easy to miss. Here is the link for the docs: [https://www.better-auth.com/docs/plugins/generic-oauth](url) There’s a single line in the Generic OAuth section that says: `“The plugin mounts a route to handle the OAuth callback /oauth2/callback/:providerId. This means by default ${baseURL}/api/auth/oauth2/callback/:providerId will be used as the callback URL.”` The problem is that it’s buried in the middle of the configuration section and there’s no example or table showing “this is the redirect URI you need to register”, so it’s not obvious unless you already know what you’re looking for. Totally agree that a short list/table of the generated OAuth routes (especially the callback/redirect one) would make the docs much clearer and save people time.
Author
Owner

@ViggoV commented on GitHub (Aug 21, 2025):

Ah, I was going by this guide: https://www.better-auth.com/docs/authentication/other-social-providers and completely missed the link to the plugin docs.

That helps quite a lot but it still gets confusing when mixing and matching providers and integrations. It gets overly blackboxy with the NextJS catch-all route handler, when there is no clear api reference listing the endpoints handled

@ViggoV commented on GitHub (Aug 21, 2025): Ah, I was going by this guide: [https://www.better-auth.com/docs/authentication/other-social-providers](https://www.better-auth.com/docs/authentication/other-social-providers) and completely missed the link to the plugin docs. That helps quite a lot but it still gets confusing when mixing and matching providers and integrations. It gets overly blackboxy with the NextJS catch-all route handler, when there is no clear api reference listing the endpoints handled
Author
Owner

@ping-maxwell commented on GitHub (Aug 23, 2025):

There are also more information in our oauth docs about how we go about the callback URL the specific here:
https://www.better-auth.com/docs/concepts/oauth#how-oauth-works-in-better-auth

@ping-maxwell commented on GitHub (Aug 23, 2025): There are also more information in our oauth docs about how we go about the callback URL the specific here: https://www.better-auth.com/docs/concepts/oauth#how-oauth-works-in-better-auth
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1704