This commit is contained in:
2026-08-24 10:45:59 +02:00
parent 5da06cf05d
commit 78f10aeb87
6 changed files with 320 additions and 226 deletions
+1 -3
View File
@@ -5,7 +5,6 @@ import { env } from '$env/dynamic/public';
import { createAuthClient } from 'better-auth/client';
import {
adminClient,
genericOAuthClient,
inferAdditionalFields,
twoFactorClient,
usernameClient
@@ -19,13 +18,12 @@ export const getAuthClient = () =>
},
plugins: [
adminClient(),
genericOAuthClient(),
twoFactorClient({
onTwoFactorRedirect: async () => {
await goto(resolve('/auth/2fa'));
}
}),
usernameClient(),
inferAdditionalFields<Auth>()
inferAdditionalFields<Auth>(),
]
});
+3 -3
View File
@@ -134,11 +134,11 @@ export const disableTwoFactor = command(v.string(), async (password) => {
});
export const unlinkAccount = command(
v.object({ accountId: v.string(), providerId: v.string() }),
async ({ accountId, providerId }) => {
v.object({ accountId: v.string() }),
async ({ accountId }) => {
const { headers } = ctx();
try {
await getAuth().api.unlinkAccount({ body: { accountId, providerId }, headers });
await getAuth().api.unlinkAccount({ body: { accountId }, headers });
} catch (e) {
fail(e);
}
+1 -1
View File
@@ -279,7 +279,7 @@
title={account.accounts.length < 2 ? m.account_unlink_last_hint() : undefined}
onclick={() =>
run(
() => unlinkAccount({ accountId: acc.accountId, providerId: acc.providerId }),
() => unlinkAccount({ accountId: acc.accountId }),
m.account_unlinked()
)}
>