From 95cb5e2895c42e08830a2a6aa9c884c613cdcf3e Mon Sep 17 00:00:00 2001 From: BeerMonsterDota Date: Thu, 13 Mar 2025 23:05:20 +0300 Subject: [PATCH] feat(generic-oauth): allow basic auth (#1808) --- packages/better-auth/src/plugins/generic-oauth/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/better-auth/src/plugins/generic-oauth/index.ts b/packages/better-auth/src/plugins/generic-oauth/index.ts index 939aa50fd0..39b3b9be04 100644 --- a/packages/better-auth/src/plugins/generic-oauth/index.ts +++ b/packages/better-auth/src/plugins/generic-oauth/index.ts @@ -116,6 +116,11 @@ interface GenericOAuthConfig { * Disable sign up for new users. */ disableSignUp?: boolean; + /** + * Allows to use basic authentication for the token endpoint. + * Default is "post". + */ + authentication?: "basic" | "post"; } interface GenericOAuthOptions { @@ -234,6 +239,7 @@ export const genericOAuth = (options: GenericOAuthOptions) => { redirectURI: c.redirectURI, }, tokenEndpoint: finalTokenUrl, + authentication: c.authentication, }); }, async getUserInfo(tokens) {