diff --git a/apps/dokploy/pages/dashboard/settings/users.tsx b/apps/dokploy/pages/dashboard/settings/users.tsx index 22615314..16f90abb 100644 --- a/apps/dokploy/pages/dashboard/settings/users.tsx +++ b/apps/dokploy/pages/dashboard/settings/users.tsx @@ -29,7 +29,6 @@ export async function getServerSideProps( const { req, res } = ctx; const { user, session } = await validateRequest(req); - console.log("user", user, session); if (!user || user.role === "member") { return { redirect: { diff --git a/apps/dokploy/pages/index.tsx b/apps/dokploy/pages/index.tsx index 768498e8..70aa2f10 100644 --- a/apps/dokploy/pages/index.tsx +++ b/apps/dokploy/pages/index.tsx @@ -63,7 +63,7 @@ export default function Home({ IS_CLOUD }: Props) { const [isBackupCodeModalOpen, setIsBackupCodeModalOpen] = useState(false); const [backupCode, setBackupCode] = useState(""); const [isGithubLoading, setIsGithubLoading] = useState(false); - + const [isGoogleLoading, setIsGoogleLoading] = useState(false); const loginForm = useForm({ resolver: zodResolver(LoginSchema), defaultValues: { @@ -181,6 +181,25 @@ export default function Home({ IS_CLOUD }: Props) { } }; + const handleGoogleSignIn = async () => { + setIsGoogleLoading(true); + try { + const { error } = await authClient.signIn.social({ + provider: "google", + }); + + if (error) { + toast.error(error.message); + return; + } + } catch (error) { + toast.error("An error occurred while signing in with Google", { + description: error instanceof Error ? error.message : "Unknown error", + }); + } finally { + setIsGoogleLoading(false); + } + }; return ( <>
@@ -219,6 +238,35 @@ export default function Home({ IS_CLOUD }: Props) { Sign in with GitHub )} + {IS_CLOUD && ( + + )}
Click the link to verify your email: Verify Email

+ `, }); }, }, @@ -53,7 +55,9 @@ const { handler, api } = betterAuth({ await sendEmail({ email: user.email, subject: "Reset your password", - text: `Click the link to reset your password: ${url}`, + text: ` +

Click the link to reset your password: Reset Password

+ `, }); }, }, @@ -132,16 +136,19 @@ const { handler, api } = betterAuth({ twoFactor(), organization({ async sendInvitationEmail(data, _request) { - const inviteLink = `https://example.com/accept-invitation/${data.id}`; - // https://example.com/accept-invitation/8jlBi9Tb9isDb8mc8Sb85u1BaJYklKB2 - // sendOrganizationInvitation({ - // email: data.email, - // invitedByUsername: data.inviter.user.name, - // invitedByEmail: data.inviter.user.email, - // teamName: data.organization.name, - // inviteLink - // }) - console.log("Invitation link", inviteLink); + if (IS_CLOUD) { + const inviteLink = `http://localhost:3000/invitation?token=${data.id}`; + + console.log("Invitation link", inviteLink); + + await sendEmail({ + email: data.email, + subject: "Invitation to join organization", + text: ` +

You are invited to join ${data.organization.name} on Dokploy. Click the link to accept the invitation: Accept Invitation

+ `, + }); + } }, }), ],