Adding support for github provider.

This commit is contained in:
charlesgauthereau
2025-12-30 10:42:51 +01:00
parent 011120fdf9
commit f0598b3f59
2 changed files with 14 additions and 10 deletions
+7 -1
View File
@@ -79,7 +79,7 @@ export const auth = betterAuth({
});
},
},
socialProviders: SUPPORTED_PROVIDERS.reduce((acc: any, provider: any) => {
socialProviders: SUPPORTED_PROVIDERS.reduce((acc: any, provider: AuthProviderConfig) => {
if (!provider.isActive) return acc;
if (provider.id === "credential") return acc;
if (provider.id === "google") {
@@ -88,6 +88,12 @@ export const auth = betterAuth({
clientSecret: env.AUTH_GOOGLE_SECRET! as string,
};
}
if (provider.id === "github") {
acc.github = {
clientId: provider.credentials?.clientId,
clientSecret: provider.credentials?.clientSecret,
};
}
return acc;
}, {}),
account: {