Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
💄 Add loading ui to auth pages (#953)
Luke Vella28599e7a787a
diff --git a/apps/web/src/app/[locale]/(auth)/login/loading.tsx b/apps/web/src/app/[locale]/(auth)/login/loading.tsxnew file mode 100644index 000000000..f96791430--- /dev/null+++ b/apps/web/src/app/[locale]/(auth)/login/loading.tsx@@ -0,0 +1,9 @@+import { Spinner } from "@/components/spinner";++export default function Loading() {+ return (+ <div className="flex justify-center items-center h-72">+ <Spinner className="text-muted-foreground" />+ </div>+ );+}diff --git a/apps/web/src/app/[locale]/(auth)/login/page.tsx b/apps/web/src/app/[locale]/(auth)/login/page.tsxindex 02777985d..84874ee1a 100644--- a/apps/web/src/app/[locale]/(auth)/login/page.tsx+++ b/apps/web/src/app/[locale]/(auth)/login/page.tsx@@ -5,11 +5,11 @@ import { LoginForm } from "@/app/[locale]/(auth)/login/login-form";import { Params } from "@/app/[locale]/types";import { getTranslation } from "@/app/i18n";import { AuthCard } from "@/components/auth/auth-layout";-import { isOIDCEnabled, isSelfHosted, oidcName } from "@/utils/constants";+import { isOIDCEnabled, oidcName } from "@/utils/constants";// Self-hosted instances only have env vars for OIDC at runtime, so we need to-// use force-dynamic to avoid statically rendering this page during build time..-export const dynamic = isSelfHosted ? "force-dynamic" : "auto";+// use force-dynamic to avoid statically rendering this page during build time.+export const dynamic = "force-dynamic";export default async function LoginPage({ params }: { params: Params }) {const { t } = await getTranslation(params.locale);diff --git a/apps/web/src/components/login-link.tsx b/apps/web/src/components/login-link.tsxindex 1d4db0c86..966992244 100644--- a/apps/web/src/components/login-link.tsx+++ b/apps/web/src/components/login-link.tsx@@ -1,23 +1,17 @@import Link, { LinkProps } from "next/link";-import { usePathname, useRouter } from "next/navigation";+import { usePathname } from "next/navigation";import React from "react";export const LoginLink = React.forwardRef<HTMLAnchorElement,React.PropsWithChildren<Omit<LinkProps, "href"> & { className?: string }>>(function LoginLink({ children, ...props }, ref) {- const router = useRouter();const pathname = usePathname() ?? "/";return (<Linkref={ref}{...props}- href="/login"- onClick={async (e) => {- e.preventDefault();- props.onClick?.(e);- router.push("/login?callbackUrl=" + encodeURIComponent(pathname));- }}+ href={`/login?callbackUrl=${encodeURIComponent(pathname)}`}>{children}</Link>diff --git a/apps/web/src/utils/auth.ts b/apps/web/src/utils/auth.tsindex 22a4df0fb..172086752 100644--- a/apps/web/src/utils/auth.ts+++ b/apps/web/src/utils/auth.ts@@ -25,7 +25,7 @@ import { emailClient } from "@/utils/emails";const providers: Provider[] = [// When a user registers, we don't want to go through the email verification process- // so this providers allows us exchange the registration token for a session token+ // so this provider allows us exchange the registration token for a session tokenCredentialsProvider({id: "registration-token",name: "Registration Token",