chore: update dependencies and enhance 2FA form

- Updated `better-auth` to version 1.2.6 in multiple package.json files.
- Updated `@better-auth/utils` to version 0.2.4 in server package.json.
- Added optional `issuer` field to the 2FA form for enhanced user experience.
- Removed unnecessary console log from the profile form component.
This commit is contained in:
Mauricio Siu 2025-04-12 21:11:21 -06:00
parent 1c470b8ba7
commit 9b5cd0f5fe
5 changed files with 62 additions and 55 deletions

View File

@ -36,6 +36,7 @@ const PasswordSchema = z.object({
password: z.string().min(8, {
message: "Password is required",
}),
issuer: z.string().optional(),
});
const PinSchema = z.object({
@ -66,6 +67,7 @@ export const Enable2FA = () => {
try {
const { data: enableData, error } = await authClient.twoFactor.enable({
password: formData.password,
issuer: formData.issuer,
});
if (!enableData) {
@ -217,6 +219,26 @@ export const Enable2FA = () => {
</FormItem>
)}
/>
<FormField
control={passwordForm.control}
name="issuer"
render={({ field }) => (
<FormItem>
<FormLabel>Issuer</FormLabel>
<FormControl>
<Input
type="text"
placeholder="Enter your issuer"
{...field}
/>
</FormControl>
<FormDescription>
Enter your password to enable 2FA
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<Button
type="submit"
className="w-full"

View File

@ -57,7 +57,6 @@ export const ProfileForm = () => {
const _utils = api.useUtils();
const { data, refetch, isLoading } = api.user.get.useQuery();
console.log(data);
const {
mutateAsync,
isLoading: isUpdating,

View File

@ -92,7 +92,7 @@
"adm-zip": "^0.5.14",
"ai": "^4.0.23",
"bcrypt": "5.1.1",
"better-auth": "1.2.4",
"better-auth": "1.2.6",
"bl": "6.0.11",
"boxen": "^7.1.1",
"bullmq": "5.4.2",

View File

@ -36,11 +36,11 @@
"@ai-sdk/mistral": "^1.0.6",
"@ai-sdk/openai": "^1.0.12",
"@ai-sdk/openai-compatible": "^0.0.13",
"@better-auth/utils": "0.2.3",
"@better-auth/utils": "0.2.4",
"@oslojs/encoding": "1.1.0",
"@oslojs/crypto": "1.0.1",
"drizzle-dbml-generator": "0.10.0",
"better-auth": "1.2.4",
"better-auth": "1.2.6",
"@faker-js/faker": "^8.4.1",
"@octokit/auth-app": "^6.0.4",
"@react-email/components": "^0.0.21",

View File

@ -17,7 +17,7 @@ importers:
version: 1.9.4
'@commitlint/cli':
specifier: ^19.3.0
version: 19.3.0(@types/node@18.19.42)(typescript@5.7.2)
version: 19.3.0(@types/node@18.19.42)(typescript@5.8.3)
'@commitlint/config-conventional':
specifier: ^19.2.2
version: 19.2.2
@ -266,8 +266,8 @@ importers:
specifier: 5.1.1
version: 5.1.1(encoding@0.1.13)
better-auth:
specifier: 1.2.4
version: 1.2.4(typescript@5.5.3)
specifier: 1.2.6
version: 1.2.6
bl:
specifier: 6.0.11
version: 6.0.11
@ -607,8 +607,8 @@ importers:
specifier: ^0.0.13
version: 0.0.13(zod@3.23.8)
'@better-auth/utils':
specifier: 0.2.3
version: 0.2.3
specifier: 0.2.4
version: 0.2.4
'@faker-js/faker':
specifier: ^8.4.1
version: 8.4.1
@ -640,8 +640,8 @@ importers:
specifier: 5.1.1
version: 5.1.1(encoding@0.1.13)
better-auth:
specifier: 1.2.4
version: 1.2.4(typescript@5.5.3)
specifier: 1.2.6
version: 1.2.6
bl:
specifier: 6.0.11
version: 6.0.11
@ -924,11 +924,11 @@ packages:
'@balena/dockerignore@1.0.2':
resolution: {integrity: sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==}
'@better-auth/utils@0.2.3':
resolution: {integrity: sha512-Ap1GaSmo6JYhJhxJOpUB0HobkKPTNzfta+bLV89HfpyCAHN7p8ntCrmNFHNAVD0F6v0mywFVEUg1FUhNCc81Rw==}
'@better-auth/utils@0.2.4':
resolution: {integrity: sha512-ayiX87Xd5sCHEplAdeMgwkA0FgnXsEZBgDn890XHHwSWNqqRZDYOq3uj2Ei2leTv1I2KbG5HHn60Ah1i2JWZjQ==}
'@better-fetch/fetch@1.1.15':
resolution: {integrity: sha512-0Bl8YYj1f8qCTNHeSn5+1DWv2hy7rLBrQ8rS8Y9XYloiwZEfc3k4yspIG0llRxafxqhGCwlGRg+F8q1HZRCMXA==}
'@better-fetch/fetch@1.1.18':
resolution: {integrity: sha512-rEFOE1MYIsBmoMJtQbl32PGHHXuG2hDxvEd7rUHE0vCBoFQVSDqaVs9hkZEtHCxRoY+CljXKFCOuJ8uxqw1LcA==}
'@biomejs/biome@1.9.4':
resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==}
@ -3836,11 +3836,11 @@ packages:
before-after-hook@2.2.3:
resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==}
better-auth@1.2.4:
resolution: {integrity: sha512-/ZK2jbUjm8JwdeCLFrUWUBmexPyI9PkaLVXWLWtN60sMDHTY8B5G72wcHglo1QMFBaw4G0qFkP5ayl9k6XfDaA==}
better-auth@1.2.6:
resolution: {integrity: sha512-RVy6nfNCXpohx49zP2ChUO3zN0nvz5UXuETJIhWU+dshBKpFMk4P4hAQauM3xqTJdd9hfeB5y+segmG1oYGTJQ==}
better-call@1.0.3:
resolution: {integrity: sha512-DUKImKoDIy5UtCvQbHTg0wuBRse6gu1Yvznn7+1B3I5TeY8sclRPFce0HI+4WF2bcb+9PqmkET8nXZubrHQh9A==}
better-call@1.0.7:
resolution: {integrity: sha512-p5kEthErx3HsW9dCCvvEx+uuEdncn0ZrlqrOG3TkR1aVYgynpwYbTVU90nY8/UwfMhROzqZWs8vryainSQxrNg==}
binary-extensions@2.3.0:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
@ -7093,8 +7093,8 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
typescript@5.7.2:
resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==}
typescript@5.8.3:
resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==}
engines: {node: '>=14.17'}
hasBin: true
@ -7210,14 +7210,6 @@ packages:
v8-compile-cache-lib@3.0.1:
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
valibot@1.0.0-beta.15:
resolution: {integrity: sha512-BKy8XosZkDHWmYC+cJG74LBzP++Gfntwi33pP3D3RKztz2XV9jmFWnkOi21GoqARP8wAWARwhV6eTr1JcWzjGw==}
peerDependencies:
typescript: '>=5'
peerDependenciesMeta:
typescript:
optional: true
vfile-message@4.0.2:
resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==}
@ -7567,11 +7559,12 @@ snapshots:
'@balena/dockerignore@1.0.2': {}
'@better-auth/utils@0.2.3':
'@better-auth/utils@0.2.4':
dependencies:
typescript: 5.8.3
uncrypto: 0.1.3
'@better-fetch/fetch@1.1.15': {}
'@better-fetch/fetch@1.1.18': {}
'@biomejs/biome@1.9.4':
optionalDependencies:
@ -7678,11 +7671,11 @@ snapshots:
style-mod: 4.1.2
w3c-keyname: 2.2.8
'@commitlint/cli@19.3.0(@types/node@18.19.42)(typescript@5.7.2)':
'@commitlint/cli@19.3.0(@types/node@18.19.42)(typescript@5.8.3)':
dependencies:
'@commitlint/format': 19.3.0
'@commitlint/lint': 19.2.2
'@commitlint/load': 19.2.0(@types/node@18.19.42)(typescript@5.7.2)
'@commitlint/load': 19.2.0(@types/node@18.19.42)(typescript@5.8.3)
'@commitlint/read': 19.2.1
'@commitlint/types': 19.0.3
execa: 8.0.1
@ -7729,15 +7722,15 @@ snapshots:
'@commitlint/rules': 19.0.3
'@commitlint/types': 19.0.3
'@commitlint/load@19.2.0(@types/node@18.19.42)(typescript@5.7.2)':
'@commitlint/load@19.2.0(@types/node@18.19.42)(typescript@5.8.3)':
dependencies:
'@commitlint/config-validator': 19.0.3
'@commitlint/execute-rule': 19.0.0
'@commitlint/resolve-extends': 19.1.0
'@commitlint/types': 19.0.3
chalk: 5.3.0
cosmiconfig: 9.0.0(typescript@5.7.2)
cosmiconfig-typescript-loader: 5.0.0(@types/node@18.19.42)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2)
cosmiconfig: 9.0.0(typescript@5.8.3)
cosmiconfig-typescript-loader: 5.0.0(@types/node@18.19.42)(cosmiconfig@9.0.0(typescript@5.8.3))(typescript@5.8.3)
lodash.isplainobject: 4.0.6
lodash.merge: 4.6.2
lodash.uniq: 4.5.0
@ -10547,27 +10540,24 @@ snapshots:
before-after-hook@2.2.3: {}
better-auth@1.2.4(typescript@5.5.3):
better-auth@1.2.6:
dependencies:
'@better-auth/utils': 0.2.3
'@better-fetch/fetch': 1.1.15
'@better-auth/utils': 0.2.4
'@better-fetch/fetch': 1.1.18
'@noble/ciphers': 0.6.0
'@noble/hashes': 1.7.1
'@simplewebauthn/browser': 13.1.0
'@simplewebauthn/server': 13.1.1
better-call: 1.0.3
better-call: 1.0.7
defu: 6.1.4
jose: 5.9.6
kysely: 0.27.6
nanostores: 0.11.3
valibot: 1.0.0-beta.15(typescript@5.5.3)
zod: 3.24.1
transitivePeerDependencies:
- typescript
better-call@1.0.3:
better-call@1.0.7:
dependencies:
'@better-fetch/fetch': 1.1.15
'@better-fetch/fetch': 1.1.18
rou3: 0.5.1
set-cookie-parser: 2.7.1
uncrypto: 0.1.3
@ -10942,21 +10932,21 @@ snapshots:
core-js@3.39.0: {}
cosmiconfig-typescript-loader@5.0.0(@types/node@18.19.42)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2):
cosmiconfig-typescript-loader@5.0.0(@types/node@18.19.42)(cosmiconfig@9.0.0(typescript@5.8.3))(typescript@5.8.3):
dependencies:
'@types/node': 18.19.42
cosmiconfig: 9.0.0(typescript@5.7.2)
cosmiconfig: 9.0.0(typescript@5.8.3)
jiti: 1.21.6
typescript: 5.7.2
typescript: 5.8.3
cosmiconfig@9.0.0(typescript@5.7.2):
cosmiconfig@9.0.0(typescript@5.8.3):
dependencies:
env-paths: 2.2.1
import-fresh: 3.3.0
js-yaml: 4.1.0
parse-json: 5.2.0
optionalDependencies:
typescript: 5.7.2
typescript: 5.8.3
cpu-features@0.0.10:
dependencies:
@ -14171,7 +14161,7 @@ snapshots:
typescript@5.5.3: {}
typescript@5.7.2: {}
typescript@5.8.3: {}
ufo@1.5.4: {}
@ -14292,10 +14282,6 @@ snapshots:
v8-compile-cache-lib@3.0.1:
optional: true
valibot@1.0.0-beta.15(typescript@5.5.3):
optionalDependencies:
typescript: 5.5.3
vfile-message@4.0.2:
dependencies:
'@types/unist': 3.0.3