fix: disable register,link/unlink

This commit is contained in:
Théo LAGACHE
2026-02-27 11:49:38 +01:00
parent 1640b326be
commit 646719557c
4 changed files with 33 additions and 31 deletions
@@ -55,20 +55,12 @@ export function ProfileProviders({
const { mutate: linkAccount } = useMutation({
mutationFn: async (provider: AuthProviderConfig) => {
setLoadingProvider(provider.id);
let result;
if (provider.type === "sso") {
result = await authClient.signIn.sso({
providerId: provider.id,
providerType: "oidc",
callbackURL: "/dashboard",
});
} else {
result = await authClient.linkSocial({
provider: provider.id as any,
if (provider.type === "social") {
await authClient.linkSocial({
provider: provider.id as string,
callbackURL: "/dashboard",
});
}
if (result.error) throw result.error;
},
onSuccess: () => {
setLoadingProvider(null);
@@ -96,7 +88,10 @@ export function ProfileProviders({
totalConnected > 1 || (totalConnected === 1 && !provider.isManual);
const isLoading = loadingProvider === provider.id;
const isUnlinkDisabled = !canUnlink || provider.allowUnlinking === false;
const isUnlinkDisabled =
!canUnlink ||
provider.allowUnlinking === false ||
provider.type === "sso";
const unlinkButton = (
<Button
@@ -112,7 +107,9 @@ export function ProfileProviders({
let actionElement;
if (!isConnected) {
if (provider.type === "sso") {
actionElement = null;
} else if (!isConnected) {
actionElement =
provider.id === "credential" ? (
<SetPasswordProfileProviderModal
+1 -1
View File
@@ -23,7 +23,7 @@ export async function init() {
(env.AUTH_GITHUB_ID && env.AUTH_GITHUB_SECRET)
) {
console.warn(
"[Deprecation Warning] You have set up OAuth credentials in your environment variables, but the format is now different. Please update your environment variables to use the new format. For example, if you were using AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET, you should now use AUTH_GOOGLE_CLIENT and AUTH_GOOGLE_SECRET. Please refer to the documentation for more details.",
"[Deprecation Warning] You have set up OAuth credentials in your environment variables, but the format is now different. Please update your environment variables to use the new format. For example, if you were using AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET, you should now use AUTH_SOCIAL_GOOGLE_CLIENT and AUTH_SOCIAL_GOOGLE_SECRET. Please refer to the documentation for more details. (https://portabase.io/docs/dashboard/auth/oauth2/setup#dynamic-providers)",
);
}
}