Add whitelabeled name to login page

This commit is contained in:
Weves 2024-06-05 18:55:51 -07:00 committed by Chris Weaver
parent 694d20ea8f
commit bdcfb39724
2 changed files with 20 additions and 3 deletions

View File

@ -0,0 +1,17 @@
"use client";
import React from "react";
import { useContext } from "react";
import { SettingsContext } from "@/components/settings/SettingsProvider";
export const LoginText = () => {
const settings = useContext(SettingsContext);
if (!settings) {
throw new Error("SettingsContext is not available");
}
return (
<>Log In to {settings?.enterpriseSettings?.application_name || "Danswer"}</>
);
};

View File

@ -7,12 +7,12 @@ import {
AuthTypeMetadata,
} from "@/lib/userSS";
import { redirect } from "next/navigation";
import Image from "next/image";
import { SignInButton } from "./SignInButton";
import { EmailPasswordForm } from "./EmailPasswordForm";
import { Card, Title, Text } from "@tremor/react";
import Link from "next/link";
import { Logo } from "@/components/Logo";
import { LoginText } from "./LoginText";
const Page = async ({
searchParams,
@ -74,7 +74,7 @@ const Page = async ({
{authUrl && authTypeMetadata && (
<>
<h2 className="text-center text-xl text-strong font-bold mt-6">
Log In to Danswer
<LoginText />
</h2>
<SignInButton
@ -87,7 +87,7 @@ const Page = async ({
<Card className="mt-4 w-96">
<div className="flex">
<Title className="mb-2 mx-auto font-bold">
Log In to Danswer
<LoginText />
</Title>
</div>
<EmailPasswordForm />