diff --git a/apps/web/public/android-chrome-192x192.png b/apps/web/public/android-chrome-192x192.png index 326b71d6a14..509705e6c20 100644 Binary files a/apps/web/public/android-chrome-192x192.png and b/apps/web/public/android-chrome-192x192.png differ diff --git a/apps/web/public/android-chrome-512x512.png b/apps/web/public/android-chrome-512x512.png index b48a4319002..5116785377d 100644 Binary files a/apps/web/public/android-chrome-512x512.png and b/apps/web/public/android-chrome-512x512.png differ diff --git a/apps/web/public/apple-touch-icon-114x114.png b/apps/web/public/apple-touch-icon-114x114.png index af31e07b2cf..f8254341b62 100644 Binary files a/apps/web/public/apple-touch-icon-114x114.png and b/apps/web/public/apple-touch-icon-114x114.png differ diff --git a/apps/web/public/apple-touch-icon-120x120.png b/apps/web/public/apple-touch-icon-120x120.png index bfc597a96b3..a387b6f909a 100644 Binary files a/apps/web/public/apple-touch-icon-120x120.png and b/apps/web/public/apple-touch-icon-120x120.png differ diff --git a/apps/web/public/apple-touch-icon-144x144.png b/apps/web/public/apple-touch-icon-144x144.png index 608ae38ab8f..8746ace595f 100644 Binary files a/apps/web/public/apple-touch-icon-144x144.png and b/apps/web/public/apple-touch-icon-144x144.png differ diff --git a/apps/web/public/apple-touch-icon-152x152.png b/apps/web/public/apple-touch-icon-152x152.png index 6f4f15f8e55..f2030c8b2e3 100644 Binary files a/apps/web/public/apple-touch-icon-152x152.png and b/apps/web/public/apple-touch-icon-152x152.png differ diff --git a/apps/web/public/apple-touch-icon-167x167.png b/apps/web/public/apple-touch-icon-167x167.png index 006474ae4fe..e3d0a641456 100644 Binary files a/apps/web/public/apple-touch-icon-167x167.png and b/apps/web/public/apple-touch-icon-167x167.png differ diff --git a/apps/web/public/apple-touch-icon-180x180.png b/apps/web/public/apple-touch-icon-180x180.png index 81d8d9de200..0f066822b1f 100644 Binary files a/apps/web/public/apple-touch-icon-180x180.png and b/apps/web/public/apple-touch-icon-180x180.png differ diff --git a/apps/web/public/apple-touch-icon-57x57.png b/apps/web/public/apple-touch-icon-57x57.png index 924b8a38c31..f33de8d9d60 100644 Binary files a/apps/web/public/apple-touch-icon-57x57.png and b/apps/web/public/apple-touch-icon-57x57.png differ diff --git a/apps/web/public/apple-touch-icon-60x60.png b/apps/web/public/apple-touch-icon-60x60.png index 933650bca70..849acc9cb49 100644 Binary files a/apps/web/public/apple-touch-icon-60x60.png and b/apps/web/public/apple-touch-icon-60x60.png differ diff --git a/apps/web/public/apple-touch-icon-72x72.png b/apps/web/public/apple-touch-icon-72x72.png index 3a0deb250ab..d49585ebff9 100644 Binary files a/apps/web/public/apple-touch-icon-72x72.png and b/apps/web/public/apple-touch-icon-72x72.png differ diff --git a/apps/web/public/apple-touch-icon-76x76.png b/apps/web/public/apple-touch-icon-76x76.png index 320c4dd0c0b..1b2bc817b6d 100644 Binary files a/apps/web/public/apple-touch-icon-76x76.png and b/apps/web/public/apple-touch-icon-76x76.png differ diff --git a/apps/web/public/bimi-logo.svg b/apps/web/public/bimi-logo.svg index 0dc113940fc..6b0ab187f44 100644 --- a/apps/web/public/bimi-logo.svg +++ b/apps/web/public/bimi-logo.svg @@ -1,9 +1,5 @@ - - bimi-svg-tiny-12-ps - - - - - - \ No newline at end of file + + + + diff --git a/apps/web/public/favicon-128x128.png b/apps/web/public/favicon-128x128.png index 1c819c2ea83..3daa53fa2bb 100644 Binary files a/apps/web/public/favicon-128x128.png and b/apps/web/public/favicon-128x128.png differ diff --git a/apps/web/public/favicon-16x16.png b/apps/web/public/favicon-16x16.png index e03c2b7abee..068748b8580 100644 Binary files a/apps/web/public/favicon-16x16.png and b/apps/web/public/favicon-16x16.png differ diff --git a/apps/web/public/favicon-194x194.png b/apps/web/public/favicon-194x194.png new file mode 100644 index 00000000000..d9f87b45cd5 Binary files /dev/null and b/apps/web/public/favicon-194x194.png differ diff --git a/apps/web/public/favicon-196x196.png b/apps/web/public/favicon-196x196.png index 1fac3c0f78f..f84faa4a485 100644 Binary files a/apps/web/public/favicon-196x196.png and b/apps/web/public/favicon-196x196.png differ diff --git a/apps/web/public/favicon-32x32.png b/apps/web/public/favicon-32x32.png index f74b129889c..0f5c4f62e08 100644 Binary files a/apps/web/public/favicon-32x32.png and b/apps/web/public/favicon-32x32.png differ diff --git a/apps/web/public/favicon-96x96.png b/apps/web/public/favicon-96x96.png index b458ce5e0b4..b23d8e8ba9c 100644 Binary files a/apps/web/public/favicon-96x96.png and b/apps/web/public/favicon-96x96.png differ diff --git a/apps/web/public/favicon.ico b/apps/web/public/favicon.ico index 985ba7b5e00..41863a015a1 100644 Binary files a/apps/web/public/favicon.ico and b/apps/web/public/favicon.ico differ diff --git a/apps/web/public/favicon.svg b/apps/web/public/favicon.svg index 938d2595bad..7f371020be6 100644 --- a/apps/web/public/favicon.svg +++ b/apps/web/public/favicon.svg @@ -1,5 +1,4 @@ - - - - + + + diff --git a/apps/web/public/mstile-144x144.png b/apps/web/public/mstile-144x144.png index 608ae38ab8f..42d7b4d7fb6 100644 Binary files a/apps/web/public/mstile-144x144.png and b/apps/web/public/mstile-144x144.png differ diff --git a/apps/web/public/mstile-150x150.png b/apps/web/public/mstile-150x150.png index 1a69561128d..76066bb25a7 100644 Binary files a/apps/web/public/mstile-150x150.png and b/apps/web/public/mstile-150x150.png differ diff --git a/apps/web/public/mstile-310x150.png b/apps/web/public/mstile-310x150.png index a9a7330ec7c..81f4303054e 100644 Binary files a/apps/web/public/mstile-310x150.png and b/apps/web/public/mstile-310x150.png differ diff --git a/apps/web/public/mstile-310x310.png b/apps/web/public/mstile-310x310.png index d9c19267701..1a3ce227505 100644 Binary files a/apps/web/public/mstile-310x310.png and b/apps/web/public/mstile-310x310.png differ diff --git a/apps/web/public/mstile-70x70.png b/apps/web/public/mstile-70x70.png index ce5fac7acf4..2d15cbdf7b1 100644 Binary files a/apps/web/public/mstile-70x70.png and b/apps/web/public/mstile-70x70.png differ diff --git a/apps/web/src/app/[locale]/(auth)/login/login-form.tsx b/apps/web/src/app/[locale]/(auth)/login/login-form.tsx index d4a2adcf9c2..8cb52aceee0 100644 --- a/apps/web/src/app/[locale]/(auth)/login/login-form.tsx +++ b/apps/web/src/app/[locale]/(auth)/login/login-form.tsx @@ -7,7 +7,7 @@ import { AlertTriangleIcon, UserIcon } from "lucide-react"; import Image from "next/image"; import { useRouter, useSearchParams } from "next/navigation"; import { getProviders, signIn, useSession } from "next-auth/react"; -import React from "react"; +import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; @@ -40,6 +40,7 @@ export function LoginForm() { const [email, setEmail] = React.useState(); const router = useRouter(); const callbackUrl = searchParams?.get("callbackUrl") ?? "/"; + const autoOidcRedirect = searchParams?.get("autoOidcRedirect") ?? '0'; const error = searchParams?.get("error"); @@ -106,6 +107,12 @@ export function LoginForm() { return res; }, [callbackUrl, posthog, providers, router, t]); + useEffect(() => { + if (alternativeLoginMethods.length === 1 && autoOidcRedirect === '1' && !error) { + alternativeLoginMethods[0].login(); + } + }, [alternativeLoginMethods, autoOidcRedirect, error]); + if (!providers) { return (
@@ -145,59 +152,9 @@ export function LoginForm() { ); } - return ( -
{ - const res = await sendVerificationEmail(email); - - if (res?.error) { - setError("email", { - message: t("userNotFound"), - }); - } else { - setEmail(email); - } - })} - > -
{t("login")}
-

- {t("stepSummary", { - current: 1, - total: 2, - })} -

-
- - - {formState.errors.email?.message ? ( -
- {formState.errors.email.message} -
- ) : null} -
-
- + if (error) { + return ( + <> {error === "OAuthAccountNotLinked" ? ( @@ -213,26 +170,34 @@ export function LoginForm() { })} - ) : null} - {alternativeLoginMethods.length > 0 ? ( - <> -
-
- - {t("or", { defaultValue: "Or" })} - -
-
- {alternativeLoginMethods.map((method, i) => ( - - ))} -
- - ) : null} -
-
+ ) : ( + + Fehler + {error} + + )} + + ); + } + + if (autoOidcRedirect === '1') { + return null; + } + + return ( + <> + {alternativeLoginMethods.length > 0 ? ( + <> +
+ {alternativeLoginMethods.map((method, i) => ( + + ))} +
+ + ) : null} + ); } diff --git a/apps/web/src/app/[locale]/(auth)/login/page.tsx b/apps/web/src/app/[locale]/(auth)/login/page.tsx index 10caefed979..28d6c85a88a 100644 --- a/apps/web/src/app/[locale]/(auth)/login/page.tsx +++ b/apps/web/src/app/[locale]/(auth)/login/page.tsx @@ -13,16 +13,6 @@ export default async function LoginPage({ params }: { params: Params }) { -
- , - }} - /> -
); } diff --git a/apps/web/src/app/[locale]/(auth)/register/page.tsx b/apps/web/src/app/[locale]/(auth)/register/page.tsx deleted file mode 100644 index ffab0cecde4..00000000000 --- a/apps/web/src/app/[locale]/(auth)/register/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { RegisterForm } from "@/app/[locale]/(auth)/register/register-page"; -import { Params } from "@/app/[locale]/types"; -import { getTranslation } from "@/app/i18n"; - -export default async function Page() { - return ; -} - -export async function generateMetadata({ params }: { params: Params }) { - const { t } = await getTranslation(params.locale); - return { - title: t("register"), - }; -} diff --git a/apps/web/src/app/[locale]/(auth)/register/register-page.tsx b/apps/web/src/app/[locale]/(auth)/register/register-page.tsx deleted file mode 100644 index 2fdbc808d07..00000000000 --- a/apps/web/src/app/[locale]/(auth)/register/register-page.tsx +++ /dev/null @@ -1,213 +0,0 @@ -"use client"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Button } from "@rallly/ui/button"; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@rallly/ui/form"; -import { Input } from "@rallly/ui/input"; -import { TRPCClientError } from "@trpc/client"; -import Link from "next/link"; -import { useParams, useSearchParams } from "next/navigation"; -import { signIn } from "next-auth/react"; -import { useTranslation } from "next-i18next"; -import { usePostHog } from "posthog-js/react"; -import React from "react"; -import { useForm } from "react-hook-form"; -import { z } from "zod"; - -import { VerifyCode } from "@/components/auth/auth-forms"; -import { AuthCard } from "@/components/auth/auth-layout"; -import { Trans } from "@/components/trans"; -import { useDayjs } from "@/utils/dayjs"; -import { trpc } from "@/utils/trpc/client"; - -const registerFormSchema = z.object({ - name: z.string().nonempty().max(100), - email: z.string().email(), -}); - -type RegisterFormData = z.infer; - -export const RegisterForm = () => { - const { t } = useTranslation(); - const { timeZone } = useDayjs(); - const params = useParams<{ locale: string }>(); - const searchParams = useSearchParams(); - const form = useForm({ - defaultValues: { email: "", name: "" }, - resolver: zodResolver(registerFormSchema), - }); - - const { handleSubmit, control, getValues, setError, formState } = form; - const queryClient = trpc.useUtils(); - const requestRegistration = trpc.auth.requestRegistration.useMutation(); - const authenticateRegistration = - trpc.auth.authenticateRegistration.useMutation(); - const [token, setToken] = React.useState(); - const posthog = usePostHog(); - if (token) { - return ( - - { - // get user's time zone - const locale = params?.locale ?? "en"; - const res = await authenticateRegistration.mutateAsync({ - token, - timeZone, - locale, - code, - }); - - if (!res.user) { - throw new Error("Failed to authenticate user"); - } - - queryClient.invalidate(); - - posthog?.identify(res.user.id, { - email: res.user.email, - name: res.user.name, - }); - - signIn("registration-token", { - token, - callbackUrl: searchParams?.get("callbackUrl") ?? undefined, - }); - }} - email={getValues("email")} - /> - - ); - } - - return ( -
- -
- { - try { - await requestRegistration.mutateAsync( - { - email: data.email, - name: data.name, - }, - { - onSuccess: (res) => { - if (!res.ok) { - switch (res.reason) { - case "userAlreadyExists": - setError("email", { - message: t("userAlreadyExists"), - }); - break; - case "emailNotAllowed": - setError("email", { - message: t("emailNotAllowed"), - }); - break; - } - } else { - setToken(res.token); - } - }, - }, - ); - } catch (error) { - if (error instanceof TRPCClientError) { - setError("root", { - message: error.shape.message, - }); - } - } - })} - > -
- {t("createAnAccount")} -
-

- {t("stepSummary", { - current: 1, - total: 2, - })} -

-
- ( - - {t("name")} - - - - - - )} - /> - ( - - {t("email")} - - - - - - )} - /> -
-
- -
- {formState.errors.root ? ( - - {formState.errors.root.message} - - ) : null} -
- -
- {!form.formState.isSubmitSuccessful ? ( -
- , - }} - /> -
- ) : null} -
- ); -}; diff --git a/apps/web/src/components/login-link.tsx b/apps/web/src/components/login-link.tsx index 966992244e3..8bd2e384a61 100644 --- a/apps/web/src/components/login-link.tsx +++ b/apps/web/src/components/login-link.tsx @@ -11,7 +11,7 @@ export const LoginLink = React.forwardRef< {children} diff --git a/apps/web/src/components/new-participant-modal.tsx b/apps/web/src/components/new-participant-modal.tsx index 6dc75dba1a2..932026b4812 100644 --- a/apps/web/src/components/new-participant-modal.tsx +++ b/apps/web/src/components/new-participant-modal.tsx @@ -15,6 +15,7 @@ import { usePoll } from "@/contexts/poll"; import { useAddParticipantMutation } from "./poll/mutations"; import VoteIcon from "./poll/vote-icon"; +import { useUser } from "@/components/user-provider"; const requiredEmailSchema = z.object({ requireEmail: z.literal(true), @@ -86,14 +87,15 @@ const VoteSummary = ({ export const NewParticipantForm = (props: NewParticipantModalProps) => { const { t } = useTranslation(); const poll = usePoll(); - + const { user } = useUser(); const isEmailRequired = poll.requireParticipantEmail; - const { register, setError, formState, setFocus, handleSubmit } = useForm({ resolver: zodResolver(schema), defaultValues: { requireEmail: isEmailRequired, + name: user.name, + email: user.email ?? '', }, }); const addParticipant = useAddParticipantMutation(); diff --git a/apps/web/src/components/user-dropdown.tsx b/apps/web/src/components/user-dropdown.tsx index cfb7a7f189d..76ca2cc4134 100644 --- a/apps/web/src/components/user-dropdown.tsx +++ b/apps/web/src/components/user-dropdown.tsx @@ -159,12 +159,6 @@ export const UserDropdown = ({ className }: { className?: string }) => { - - - - - -