Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const {
const existingAccount = await getAccountByUserId(existingUser.id)

token.isOAuth = !!existingAccount
token.name = existingUser.username
token.name = existingUser.name
token.email = existingUser.email
token.role = existingUser.role
token.isTwoFactorEnabled = existingUser.isTwoFactorEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function updateUserName(userId: string, data: FormData) {
id: userId,
},
data: {
username: name,
name: name,
},
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/marketing/pricing/forms/user-name.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function updateUserName(userId: string, data: FormData) {
if (!parsed.success) {
return { status: "error" as const };
}
await db.user.update({ where: { id: userId }, data: { username: parsed.data.name } });
await db.user.update({ where: { id: userId }, data: { name: parsed.data.name } });
revalidatePath("/dashboard/settings");
return { status: "success" as const };
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/marketing/pricing/lib/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const sendVerificationRequest: EmailConfig["sendVerificationRequest"] =
: identifier,
subject: authSubject,
react: MagicLinkEmail({
firstName: (user.username ?? "") as string,
firstName: (user.name ?? "") as string,
actionUrl: url,
mailType: userVerified ? "login" : "register",
siteName: siteConfig.name,
Expand Down
2 changes: 1 addition & 1 deletion src/components/marketing/pricing/lib/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const getUserByEmail = async (email: string) => {
email: email,
},
select: {
username: true,
name: true,
emailVerified: true,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function DeleteAccountModal({
<div className="flex flex-col items-center justify-center space-y-3 border-b p-4 pt-8 sm:px-16">
<UserAvatar
user={{
username: (session?.user as any)?.username ?? session?.user?.name ?? null,
name: session?.user?.name ?? null,
image: session?.user?.image || null,
}}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/marketing/pricing/shared/user-avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Icons } from "@/components/marketing/pricing/shared/icons"

interface UserAvatarProps extends AvatarProps {
user: Pick<User, "image" | "username">
user: Pick<User, "image" | "name">
}

export function UserAvatar({ user, ...props }: UserAvatarProps) {
Expand All @@ -15,7 +15,7 @@ export function UserAvatar({ user, ...props }: UserAvatarProps) {
<AvatarImage alt="Picture" src={user.image} referrerPolicy="no-referrer" />
) : (
<AvatarFallback>
<span className="sr-only">{user.username ?? ""}</span>
<span className="sr-only">{user.name ?? ""}</span>
<Icons.user className="size-4" />
</AvatarFallback>
)}
Expand Down