Skip to content

Commit 1b7193a

Browse files
authored
Merge pull request #636 from mnfst/fix-login
fix(signUp): validation error
2 parents 45e5c59 + b341fb8 commit 1b7193a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/manifest/frontend/src/components/auth/SignupForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export function SignupForm({ onSuccess }: SignupFormProps) {
4545
email,
4646
password,
4747
name: `${firstName.trim()} ${lastName.trim()}`,
48+
firstName: firstName.trim(),
49+
lastName: lastName.trim(),
4850
});
4951

5052
if (result.error) {

packages/manifest/frontend/src/lib/auth-client.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createAuthClient } from 'better-auth/react';
2+
import { inferAdditionalFields } from 'better-auth/client/plugins';
23
import { BACKEND_URL } from './api';
34

45
/**
@@ -7,6 +8,14 @@ import { BACKEND_URL } from './api';
78
*/
89
export const authClient = createAuthClient({
910
baseURL: BACKEND_URL,
11+
plugins: [
12+
inferAdditionalFields({
13+
user: {
14+
firstName: { type: 'string' },
15+
lastName: { type: 'string' },
16+
},
17+
}),
18+
],
1019
});
1120

1221
// Export commonly used methods for convenience

0 commit comments

Comments
 (0)