diff --git a/web/src/app/auth/logout/route.ts b/web/src/app/auth/logout/route.ts
index e3bae04bb22..cd731810ca3 100644
--- a/web/src/app/auth/logout/route.ts
+++ b/web/src/app/auth/logout/route.ts
@@ -1,4 +1,4 @@
-import { CLOUD_ENABLED } from "@/lib/constants";
+import { NEXT_PUBLIC_CLOUD_ENABLED } from "@/lib/constants";
import { getAuthTypeMetadataSS, logoutSS } from "@/lib/userSS";
import { NextRequest } from "next/server";
@@ -13,7 +13,7 @@ export const POST = async (request: NextRequest) => {
}
// Delete cookies only if cloud is enabled (jwt auth)
- if (CLOUD_ENABLED) {
+ if (NEXT_PUBLIC_CLOUD_ENABLED) {
const cookiesToDelete = ["fastapiusersauth", "tenant_details"];
const cookieOptions = {
path: "/",
diff --git a/web/src/app/auth/signup/page.tsx b/web/src/app/auth/signup/page.tsx
index ec276a09672..5a90535df59 100644
--- a/web/src/app/auth/signup/page.tsx
+++ b/web/src/app/auth/signup/page.tsx
@@ -4,13 +4,14 @@ import {
getCurrentUserSS,
getAuthTypeMetadataSS,
AuthTypeMetadata,
+ getAuthUrlSS,
} from "@/lib/userSS";
import { redirect } from "next/navigation";
import { EmailPasswordForm } from "../login/EmailPasswordForm";
-import { Card, Title, Text } from "@tremor/react";
+import { Text } from "@tremor/react";
import Link from "next/link";
-import { Logo } from "@/components/Logo";
-import { CLOUD_ENABLED } from "@/lib/constants";
+import { SignInButton } from "../login/SignInButton";
+import AuthFlowContainer from "@/components/auth/AuthFlowContainer";
const Page = async () => {
// catch cases where the backend is completely unreachable here
@@ -26,9 +27,6 @@ const Page = async () => {
} catch (e) {
console.log(`Some fetch failed for the login page - ${e}`);
}
- if (CLOUD_ENABLED) {
- return redirect("/auth/login");
- }
// simply take the user to the home page if Auth is disabled
if (authTypeMetadata?.authType === "disabled") {
@@ -42,44 +40,56 @@ const Page = async () => {
}
return redirect("/auth/waiting-on-verification");
}
+ const cloud = authTypeMetadata?.authType === "cloud";
// only enable this page if basic login is enabled
- if (authTypeMetadata?.authType !== "basic") {
+ if (authTypeMetadata?.authType !== "basic" && !cloud) {
return redirect("/");
}
+ let authUrl: string | null = null;
+ if (cloud && authTypeMetadata) {
+ authUrl = await getAuthUrlSS(authTypeMetadata.authType, null);
+ }
+
return (
-
-
-
-
-
-
-
+
+
-
-
-
- Sign Up for Danswer
-
-
-
+ <>
+
+
+
+ {cloud ? "Complete your sign up" : "Sign Up for Danswer"}
+
-
-
- Already have an account?{" "}
-
- Log In
-
-
+ {cloud && authUrl && (
+
-
+ )}
+
+
+
+
+
+ Already have an account?{" "}
+
+ Log In
+
+
+
-
-
+ >
+
);
};
diff --git a/web/src/app/chat/ChatPage.tsx b/web/src/app/chat/ChatPage.tsx
index b67ec473026..2ce657b2caf 100644
--- a/web/src/app/chat/ChatPage.tsx
+++ b/web/src/app/chat/ChatPage.tsx
@@ -809,7 +809,6 @@ export function ChatPage({
// Check if all messages are currently rendered
if (currentVisibleRange.end < messageHistory.length) {
- console.log("Updating visible range");
// Update visible range to include the last messages
updateCurrentVisibleRange({
start: Math.max(
diff --git a/web/src/app/chat/lib.tsx b/web/src/app/chat/lib.tsx
index 3fbb9397abc..38fdac037a6 100644
--- a/web/src/app/chat/lib.tsx
+++ b/web/src/app/chat/lib.tsx
@@ -348,7 +348,6 @@ export function getCitedDocumentsFromMessage(message: Message) {
}
export function groupSessionsByDateRange(chatSessions: ChatSession[]) {
- console.log(chatSessions);
const today = new Date();
today.setHours(0, 0, 0, 0); // Set to start of today for accurate comparison
diff --git a/web/src/app/chat/message/CodeBlock.tsx b/web/src/app/chat/message/CodeBlock.tsx
index c1f2f99397c..5ab6b73b56e 100644
--- a/web/src/app/chat/message/CodeBlock.tsx
+++ b/web/src/app/chat/message/CodeBlock.tsx
@@ -116,6 +116,7 @@ export const CodeBlock = memo(function CodeBlock({
{codeText &&
}
)}
+
);
diff --git a/web/src/app/chat/message/codeUtils.ts b/web/src/app/chat/message/codeUtils.ts
index d2aad299044..a9cd13944f0 100644
--- a/web/src/app/chat/message/codeUtils.ts
+++ b/web/src/app/chat/message/codeUtils.ts
@@ -1,3 +1,5 @@
+import React from "react";
+
export function extractCodeText(
node: any,
content: string,
@@ -32,7 +34,27 @@ export function extractCodeText(
codeText = formattedCodeLines.join("\n").trim();
} else {
// Fallback if position offsets are not available
- codeText = children?.toString() || null;
+ const extractTextFromReactNode = (node: React.ReactNode): string => {
+ if (typeof node === "string") return node;
+ if (typeof node === "number") return String(node);
+ if (!node) return "";
+
+ if (React.isValidElement(node)) {
+ const children = node.props.children;
+ if (Array.isArray(children)) {
+ return children.map(extractTextFromReactNode).join("");
+ }
+ return extractTextFromReactNode(children);
+ }
+
+ if (Array.isArray(node)) {
+ return node.map(extractTextFromReactNode).join("");
+ }
+
+ return "";
+ };
+
+ codeText = extractTextFromReactNode(children);
}
return codeText || "";
diff --git a/web/src/app/chat/page.tsx b/web/src/app/chat/page.tsx
index 3c872390c1b..4f91699b48c 100644
--- a/web/src/app/chat/page.tsx
+++ b/web/src/app/chat/page.tsx
@@ -32,38 +32,29 @@ export default async function Page({
openedFolders,
defaultAssistantId,
shouldShowWelcomeModal,
- assistants,
userInputPrompts,
- hasAnyConnectors,
- hasImageCompatibleModel,
} = data;
return (
<>
{shouldShowWelcomeModal && }
-
-
-
-
-
+
+
>
);
}
diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx
index 41611266f61..e6339ade9fb 100644
--- a/web/src/app/layout.tsx
+++ b/web/src/app/layout.tsx
@@ -19,6 +19,8 @@ import { HeaderTitle } from "@/components/header/HeaderTitle";
import { Logo } from "@/components/Logo";
import { UserProvider } from "@/components/user/UserProvider";
import { ProviderContextProvider } from "@/components/chat_search/ProviderContext";
+import { fetchAssistantData } from "@/lib/chat/fetchAssistantdata";
+import { AppProvider } from "@/components/context/AppProvider";
const inter = Inter({
subsets: ["latin"],
@@ -55,6 +57,10 @@ export default async function RootLayout({
}) {
const combinedSettings = await fetchSettingsSS();
+ const data = await fetchAssistantData();
+
+ const { assistants, hasAnyConnectors, hasImageCompatibleModel } = data;
+
const productGating =
combinedSettings?.settings.product_gating ?? GatingType.NONE;
@@ -174,27 +180,14 @@ export default async function RootLayout({
process.env.THEME_IS_DARK?.toLowerCase() === "true" ? "dark" : ""
}`}
>
- {productGating === GatingType.PARTIAL && (
-
- )}
-
-
-
- {children}
-
-
-
+
+ {children}
+