parent
e64cdabb17
commit
a83ce9be50
8 changed files with 5778 additions and 40 deletions
|
|
@ -74,8 +74,6 @@ export const auth = betterAuth({
|
|||
image: "imageUrl",
|
||||
},
|
||||
additionalFields: {
|
||||
firstName: { type: "string", required: false, fieldName: "firstName" },
|
||||
lastName: { type: "string", required: false, fieldName: "lastName" },
|
||||
username: { type: "string", required: false, fieldName: "username" },
|
||||
isAdmin: { type: "boolean", defaultValue: false, fieldName: "isAdmin" },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -189,8 +189,6 @@ describe('Team Management - Admin User List', () => {
|
|||
emailVerified: true,
|
||||
username: 'user1',
|
||||
displayName: 'User One',
|
||||
firstName: 'User',
|
||||
lastName: 'One',
|
||||
imageUrl: null,
|
||||
flagConfig: null,
|
||||
customAvatarUrl: null,
|
||||
|
|
@ -207,8 +205,6 @@ describe('Team Management - Admin User List', () => {
|
|||
emailVerified: true,
|
||||
username: 'user2',
|
||||
displayName: 'User Two',
|
||||
firstName: 'User',
|
||||
lastName: 'Two',
|
||||
imageUrl: null,
|
||||
flagConfig: null,
|
||||
customAvatarUrl: null,
|
||||
|
|
@ -246,8 +242,6 @@ describe('Team Management - Admin User List', () => {
|
|||
emailVerified: true,
|
||||
username: 'user1',
|
||||
displayName: 'User One',
|
||||
firstName: 'User',
|
||||
lastName: 'One',
|
||||
imageUrl: null,
|
||||
flagConfig: null,
|
||||
customAvatarUrl: null,
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ export async function action(args: Route.ActionArgs) {
|
|||
|
||||
const displayName = formData.get("displayName") as string;
|
||||
const username = formData.get("username") as string | null;
|
||||
const firstName = formData.get("firstName") as string | null;
|
||||
const lastName = formData.get("lastName") as string | null;
|
||||
const timezone = formData.get("timezone") as string | null;
|
||||
|
||||
const timezoneValue =
|
||||
|
|
@ -100,8 +98,6 @@ export async function action(args: Route.ActionArgs) {
|
|||
await updateUser(session.user.id, {
|
||||
displayName: displayName || undefined,
|
||||
username: username || undefined,
|
||||
firstName: firstName || undefined,
|
||||
lastName: lastName || undefined,
|
||||
timezone: timezoneValue,
|
||||
});
|
||||
|
||||
|
|
@ -164,24 +160,6 @@ export default function UserProfilePage({ loaderData, actionData }: Route.Compon
|
|||
defaultValue={user.username ?? ""}
|
||||
/>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="firstName">First Name</Label>
|
||||
<Input
|
||||
id="firstName"
|
||||
name="firstName"
|
||||
defaultValue={user.firstName ?? ""}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="lastName">Last Name</Label>
|
||||
<Input
|
||||
id="lastName"
|
||||
name="lastName"
|
||||
defaultValue={user.lastName ?? ""}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<Label>Email</Label>
|
||||
<p className="text-sm text-muted-foreground">{user.email}</p>
|
||||
|
|
|
|||
8
app/test/fixtures/user.ts
vendored
8
app/test/fixtures/user.ts
vendored
|
|
@ -5,8 +5,6 @@ export const mockUser = {
|
|||
emailVerified: true,
|
||||
username: 'user1',
|
||||
displayName: 'User One',
|
||||
firstName: 'User',
|
||||
lastName: 'One',
|
||||
imageUrl: null,
|
||||
isAdmin: false,
|
||||
timezone: null,
|
||||
|
|
@ -21,8 +19,6 @@ export const mockAdminUser = {
|
|||
emailVerified: true,
|
||||
username: 'admin',
|
||||
displayName: 'Admin User',
|
||||
firstName: 'Admin',
|
||||
lastName: 'User',
|
||||
imageUrl: null,
|
||||
isAdmin: true,
|
||||
timezone: null,
|
||||
|
|
@ -39,8 +35,6 @@ export const mockUsers = [
|
|||
emailVerified: true,
|
||||
username: 'user2',
|
||||
displayName: 'User Two',
|
||||
firstName: 'User',
|
||||
lastName: 'Two',
|
||||
imageUrl: null,
|
||||
isAdmin: false,
|
||||
timezone: null,
|
||||
|
|
@ -54,8 +48,6 @@ export const mockUsers = [
|
|||
emailVerified: true,
|
||||
username: 'user3',
|
||||
displayName: 'User Three',
|
||||
firstName: 'User',
|
||||
lastName: 'Three',
|
||||
imageUrl: null,
|
||||
isAdmin: false,
|
||||
timezone: null,
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ export const users = pgTable("users", {
|
|||
emailVerified: boolean("email_verified").notNull().default(false),
|
||||
username: varchar("username", { length: 255 }),
|
||||
displayName: varchar("display_name", { length: 255 }), // mapped as BetterAuth's "name" field
|
||||
firstName: varchar("first_name", { length: 255 }),
|
||||
lastName: varchar("last_name", { length: 255 }),
|
||||
imageUrl: varchar("image_url", { length: 512 }), // mapped as BetterAuth's "image" field
|
||||
flagConfig: jsonb("flag_config").$type<{ pattern: string; colors: string[] }>(),
|
||||
customAvatarUrl: varchar("custom_avatar_url", { length: 512 }),
|
||||
|
|
|
|||
2
drizzle/0099_peaceful_hannibal_king.sql
Normal file
2
drizzle/0099_peaceful_hannibal_king.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE "users" DROP COLUMN IF EXISTS "first_name";--> statement-breakpoint
|
||||
ALTER TABLE "users" DROP COLUMN IF EXISTS "last_name";
|
||||
5769
drizzle/meta/0099_snapshot.json
Normal file
5769
drizzle/meta/0099_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -694,6 +694,13 @@
|
|||
"when": 1778261539567,
|
||||
"tag": "0098_lucky_sabra",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 99,
|
||||
"version": "7",
|
||||
"when": 1778341807236,
|
||||
"tag": "0099_peaceful_hannibal_king",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue