updated
This commit is contained in:
@@ -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>(),
|
||||
]
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user