Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: terms/privacy on sign-in for cloud (#549)

Marc Klingen86cfe5b94014
diff --git a/src/pages/auth/sign-in.tsx b/src/pages/auth/sign-in.tsx
index 2502eb11b3..34861570db 100644
--- a/src/pages/auth/sign-in.tsx
+++ b/src/pages/auth/sign-in.tsx
@@ -21,6 +21,8 @@ import { useState } from "react";
import { useForm } from "react-hook-form";
import * as z from "zod";
import { usePostHog } from "posthog-js/react";
+import { CloudPrivacyNotice } from "@/src/pages/auth/sign-up";
+import { Divider } from "@tremor/react";
const credentialAuthForm = z.object({
email: z.string().email(),
@@ -98,12 +100,12 @@ export default function SignIn(props: PageProps) {
</h2>
</div>
- <div className="mt-14 sm:mx-auto sm:w-full sm:max-w-[480px]">
- <div className="divide-y bg-white p-6 py-6 shadow sm:rounded-lg sm:px-12">
+ <div className="mt-14 bg-white px-6 py-10 shadow sm:mx-auto sm:w-full sm:max-w-[480px] sm:rounded-lg sm:px-12">
+ <div className="mt-2 space-y-8">
{props.authProviders.credentials ? (
<Form {...credentialsForm}>
<form
- className="space-y-6 py-6"
+ className="space-y-6"
// eslint-disable-next-line @typescript-eslint/no-misused-promises
onSubmit={credentialsForm.handleSubmit(onCredentialsSubmit)}
>
@@ -153,50 +155,58 @@ export default function SignIn(props: PageProps) {
{
// any authprovider from props is enanbles
- Object.values(props.authProviders).some((enabled) => enabled) ? (
- <div className="flex flex-row flex-wrap items-center justify-center gap-4 py-6">
- {props.authProviders.google ? (
- <Button
- onClick={() => {
- posthog.capture("sign_in:google_button_click");
- void signIn("google");
- }}
- variant="secondary"
- >
- <FcGoogle className="mr-3" size={18} />
- Sign in with Google
- </Button>
- ) : null}
- {props.authProviders.github ? (
- <Button
- onClick={() => {
- posthog.capture("sign_in:github_button_click");
- void signIn("github");
- }}
- variant="secondary"
- >
- <FaGithub className="mr-3" size={18} />
- Sign in with Github
- </Button>
+ Object.entries(props.authProviders).some(
+ ([name, enabled]) => enabled && name !== "credentials",
+ ) ? (
+ <div>
+ {props.authProviders.credentials ? (
+ <Divider className="text-gray-400" />
) : null}
+ <div className="flex flex-row flex-wrap items-center justify-center gap-4">
+ {props.authProviders.google ? (
+ <Button
+ onClick={() => {
+ posthog.capture("sign_in:google_button_click");
+ void signIn("google");
+ }}
+ variant="secondary"
+ >
+ <FcGoogle className="mr-3" size={18} />
+ Sign in with Google
+ </Button>
+ ) : null}
+ {props.authProviders.github ? (
+ <Button
+ onClick={() => {
+ posthog.capture("sign_in:github_button_click");
+ void signIn("github");
+ }}
+ variant="secondary"
+ >
+ <FaGithub className="mr-3" size={18} />
+ Sign in with Github
+ </Button>
+ ) : null}
+ </div>
</div>
) : null
}
</div>
-
- {env.NEXT_PUBLIC_SIGN_UP_DISABLED !== "true" &&
- props.authProviders.credentials ? (
- <p className="mt-10 text-center text-sm text-gray-500">
- No account yet?{" "}
- <Link
- href="/auth/sign-up"
- className="font-semibold leading-6 text-indigo-600 hover:text-indigo-500"
- >
- Sign up
- </Link>
- </p>
- ) : null}
+ <CloudPrivacyNotice action="signing in" />
</div>
+
+ {env.NEXT_PUBLIC_SIGN_UP_DISABLED !== "true" &&
+ props.authProviders.credentials ? (
+ <p className="mt-10 text-center text-sm text-gray-500">
+ No account yet?{" "}
+ <Link
+ href="/auth/sign-up"
+ className="font-semibold leading-6 text-indigo-600 hover:text-indigo-500"
+ >
+ Sign up
+ </Link>
+ </p>
+ ) : null}
</div>
</>
);
diff --git a/src/pages/auth/sign-up.tsx b/src/pages/auth/sign-up.tsx
index 62edba5f0c..7ce68af75b 100644
--- a/src/pages/auth/sign-up.tsx
+++ b/src/pages/auth/sign-up.tsx
@@ -88,127 +88,128 @@ export default function SignIn() {
</div>
) : null}
- <div className="mt-14 sm:mx-auto sm:w-full sm:max-w-[480px]">
- <div className="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
- <Form {...form}>
- <form
- className="space-y-6"
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- onSubmit={form.handleSubmit(onSubmit)}
- >
- <FormField
- control={form.control}
- name="name"
- render={({ field }) => (
- <FormItem>
- <FormLabel>Name</FormLabel>
- <FormControl>
- <Input placeholder="Jane Doe" {...field} />
- </FormControl>
- <FormMessage />
- </FormItem>
- )}
- />
- <FormField
- control={form.control}
- name="email"
- render={({ field }) => (
- <FormItem>
- <FormLabel>Email</FormLabel>
- <FormControl>
- <Input placeholder="[email protected]" {...field} />
- </FormControl>
- <FormMessage />
- </FormItem>
- )}
- />
+ <div className="mt-14 bg-white px-6 py-10 shadow sm:mx-auto sm:w-full sm:max-w-[480px] sm:rounded-lg sm:px-12">
+ <Form {...form}>
+ <form
+ className="space-y-6"
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
+ onSubmit={form.handleSubmit(onSubmit)}
+ >
+ <FormField
+ control={form.control}
+ name="name"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Name</FormLabel>
+ <FormControl>
+ <Input placeholder="Jane Doe" {...field} />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="email"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Email</FormLabel>
+ <FormControl>
+ <Input placeholder="[email protected]" {...field} />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="password"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Password</FormLabel>
+ <FormControl>
+ <Input type="password" {...field} />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ {env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined ? (
<FormField
control={form.control}
- name="password"
+ name="referralSource"
render={({ field }) => (
<FormItem>
- <FormLabel>Password</FormLabel>
+ <FormLabel>
+ Where did you hear about us?{" "}
+ <span className="font-normal">(optional)</span>
+ </FormLabel>
<FormControl>
- <Input type="password" {...field} />
+ <Input type="referralSource" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
- {env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined ? (
- <FormField
- control={form.control}
- name="referralSource"
- render={({ field }) => (
- <FormItem>
- <FormLabel>
- Where did you hear about us?{" "}
- <span className="font-normal">(optional)</span>
- </FormLabel>
- <FormControl>
- <Input type="referralSource" {...field} />
- </FormControl>
- <FormMessage />
- </FormItem>
- )}
- />
- ) : null}
- <Button
- type="submit"
- className="w-full"
- loading={form.formState.isSubmitting}
- >
- Sign up
- </Button>
- {formError ? (
- <div className="text-center text-sm font-medium text-destructive">
- {formError}
- </div>
- ) : null}
- </form>
- </Form>
- {env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined ? (
- <div className="-mb-4 mt-8 text-center text-xs text-gray-500">
- By creating an account you are agreeing to our{" "}
- <a
- href="https://app.termly.io/document/terms-of-service/baf80a2e-dc67-46de-9ca8-2f7457179c32"
- target="_blank"
- rel="noopener noreferrer"
- className="italic"
- >
- Terms of Service
- </a>
- ,{" "}
- <a
- href="https://app.termly.io/document/privacy-policy/47905712-56e1-4ad0-9bb7-8958f3263f90"
- rel="noopener noreferrer"
- className="italic"
- >
- Privacy Policy
- </a>
- , and{" "}
- <a
- href="https://app.termly.io/document/cookie-policy/f97945a3-cb02-4db7-9370-c57023d92838"
- rel="noopener noreferrer"
- className="italic"
- >
- Cookie Policy
- </a>
- </div>
- ) : null}
- </div>
-
- <p className="mt-10 text-center text-sm text-gray-500">
- Already have an account?{" "}
- <Link
- href="/auth/sign-in"
- className="font-semibold leading-6 text-indigo-600 hover:text-indigo-500"
- >
- Sign in
- </Link>
- </p>
+ ) : null}
+ <Button
+ type="submit"
+ className="w-full"
+ loading={form.formState.isSubmitting}
+ >
+ Sign up
+ </Button>
+ {formError ? (
+ <div className="text-center text-sm font-medium text-destructive">
+ {formError}
+ </div>
+ ) : null}
+ </form>
+ </Form>
+ <CloudPrivacyNotice action="creating an account" />
</div>
+
+ <p className="mt-10 text-center text-sm text-gray-500">
+ Already have an account?{" "}
+ <Link
+ href="/auth/sign-in"
+ className="font-semibold leading-6 text-indigo-600 hover:text-indigo-500"
+ >
+ Sign in
+ </Link>
+ </p>
</div>
</>
);
}
+
+export const CloudPrivacyNotice = ({ action }: { action: string }) =>
+ env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined ? (
+ <div className="mt-10 text-center text-xs text-gray-500">
+ By {action} you are agreeing to our{" "}
+ <a
+ href="https://langfuse.com/tos"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="italic"
+ >
+ Terms of Service
+ </a>
+ ,{" "}
+ <a
+ href="https://langfuse.com/privacy"
+ rel="noopener noreferrer"
+ className="italic"
+ >
+ Privacy Policy
+ </a>
+ , and{" "}
+ <a
+ href="https://langfuse.com/cookie-policy"
+ rel="noopener noreferrer"
+ className="italic"
+ >
+ Cookie Policy
+ </a>
+ </div>
+ ) : null;