mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Adding support for github provider.
This commit is contained in:
+7
-9
@@ -84,21 +84,19 @@ export const SUPPORTED_PROVIDERS: AuthProviderConfig[] = [
|
|||||||
isActive: Boolean(process.env.AUTH_GOOGLE_METHOD),
|
isActive: Boolean(process.env.AUTH_GOOGLE_METHOD),
|
||||||
// isManual: true,
|
// isManual: true,
|
||||||
credentials: {
|
credentials: {
|
||||||
clientId: process.env.GOOGLE_CLIENT_ID || "",
|
clientId: process.env.AUTH_GOOGLE_ID || "",
|
||||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "",
|
clientSecret: process.env.AUTH_GOOGLE_SECRET || "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
/*
|
|
||||||
{
|
{
|
||||||
id: "github",
|
id: "github",
|
||||||
name: "GitHub",
|
icon: "iconoir:github",
|
||||||
icon: Github,
|
isActive: Boolean(process.env.AUTH_GITHUB_METHOD),
|
||||||
description: "Connexion via GitHub",
|
|
||||||
credentials: {
|
credentials: {
|
||||||
clientId: process.env.GITHUB_CLIENT_ID || "",
|
clientId: process.env.AUTH_GITHUB_ID || "",
|
||||||
clientSecret: process.env.GITHUB_CLIENT_SECRET || "",
|
clientSecret: process.env.AUTH_GITHUB_SECRET || "",
|
||||||
},
|
},
|
||||||
},*/
|
},
|
||||||
{
|
{
|
||||||
id: "credential",
|
id: "credential",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
|||||||
@@ -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.isActive) return acc;
|
||||||
if (provider.id === "credential") return acc;
|
if (provider.id === "credential") return acc;
|
||||||
if (provider.id === "google") {
|
if (provider.id === "google") {
|
||||||
@@ -88,6 +88,12 @@ export const auth = betterAuth({
|
|||||||
clientSecret: env.AUTH_GOOGLE_SECRET! as string,
|
clientSecret: env.AUTH_GOOGLE_SECRET! as string,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (provider.id === "github") {
|
||||||
|
acc.github = {
|
||||||
|
clientId: provider.credentials?.clientId,
|
||||||
|
clientSecret: provider.credentials?.clientSecret,
|
||||||
|
};
|
||||||
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, {}),
|
}, {}),
|
||||||
account: {
|
account: {
|
||||||
|
|||||||
Reference in New Issue
Block a user