mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 12:03:54 +02:00
k
This commit is contained in:
@@ -71,8 +71,6 @@ const Page = async ({
|
||||
if (authTypeMetadata?.autoRedirect && authUrl && !autoRedirectDisabled) {
|
||||
return redirect(authUrl);
|
||||
}
|
||||
console.log("authTypeMetadata");
|
||||
console.log(authTypeMetadata);
|
||||
|
||||
return (
|
||||
<AuthFlowContainer>
|
||||
@@ -80,7 +78,7 @@ const Page = async ({
|
||||
<HealthCheckBanner />
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col justify-center">
|
||||
<div className="flex flex-col w-full justify-center">
|
||||
{authUrl && authTypeMetadata && (
|
||||
<>
|
||||
<h2 className="text-center text-xl text-strong font-bold">
|
||||
|
@@ -42,18 +42,15 @@ const Page = async () => {
|
||||
}
|
||||
return redirect("/auth/waiting-on-verification");
|
||||
}
|
||||
|
||||
// only enable this page if basic login is enabled
|
||||
if (
|
||||
authTypeMetadata?.authType !== "basic" &&
|
||||
authTypeMetadata?.authType !== "cloud"
|
||||
) {
|
||||
return redirect("/");
|
||||
}
|
||||
const cloud = authTypeMetadata?.authType === "cloud";
|
||||
|
||||
// only enable this page if basic login is enabled
|
||||
if (authTypeMetadata?.authType !== "basic" && !cloud) {
|
||||
return redirect("/");
|
||||
}
|
||||
|
||||
let authUrl: string | null = null;
|
||||
if (cloud) {
|
||||
if (cloud && authTypeMetadata) {
|
||||
authUrl = await getAuthUrlSS(authTypeMetadata.authType, null);
|
||||
}
|
||||
|
||||
@@ -63,21 +60,18 @@ const Page = async () => {
|
||||
|
||||
<>
|
||||
<div className="absolute top-10x w-full"></div>
|
||||
<div className="flex flex-col justify-center">
|
||||
<div className="flex w-full flex-col justify-center">
|
||||
<h2 className="text-center text-xl text-strong font-bold">
|
||||
{cloud ? "Complete your sign up" : "Sign Up for Danswer"}
|
||||
</h2>
|
||||
|
||||
{cloud && authUrl && (
|
||||
<div className="w-full justify-center">
|
||||
<SignInButton
|
||||
authorizeUrl={authUrl}
|
||||
authType={authTypeMetadata?.authType}
|
||||
/>
|
||||
<SignInButton authorizeUrl={authUrl} authType="cloud" />
|
||||
<div className="flex items-center w-full my-4">
|
||||
<div className="flex-grow border-t border-gray-300"></div>
|
||||
<div className="flex-grow border-t border-background-300"></div>
|
||||
<span className="px-4 text-gray-500">or</span>
|
||||
<div className="flex-grow border-t border-gray-300"></div>
|
||||
<div className="flex-grow border-t border-background-300"></div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
@@ -7,7 +7,7 @@ export default function AuthFlowContainer({
|
||||
}) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center min-h-screen bg-background">
|
||||
<div className="w-full max-w-md p-8 gap-y-4 bg-white flex items-center flex-col rounded-xl shadow-lg border border-bacgkround-100">
|
||||
<div className="w-full max-w-md bg-black p-8 mx-4 gap-y-4 bg-white flex items-center flex-col rounded-xl shadow-lg border border-bacgkround-100">
|
||||
<Logo width={70} height={70} />
|
||||
{children}
|
||||
</div>
|
||||
|
@@ -20,6 +20,8 @@ export const getAuthTypeMetadataSS = async (): Promise<AuthTypeMetadata> => {
|
||||
await res.json();
|
||||
|
||||
let authType: AuthType;
|
||||
|
||||
// Override fasapi users auth so we can use both
|
||||
if (SERVER_SIDE_ONLY__CLOUD_ENABLED) {
|
||||
authType = "cloud";
|
||||
} else {
|
||||
@@ -84,7 +86,6 @@ export const getAuthUrlSS = async (
|
||||
authType: AuthType,
|
||||
nextUrl: string | null
|
||||
): Promise<string> => {
|
||||
console.log(authType);
|
||||
// Returns the auth url for the given auth type
|
||||
switch (authType) {
|
||||
case "disabled":
|
||||
@@ -95,10 +96,7 @@ export const getAuthUrlSS = async (
|
||||
return await getGoogleOAuthUrlSS();
|
||||
}
|
||||
case "cloud": {
|
||||
console.log("returning cloud auth url");
|
||||
const value = await getGoogleOAuthUrlSS();
|
||||
console.log(value);
|
||||
return value;
|
||||
return await getGoogleOAuthUrlSS();
|
||||
}
|
||||
case "saml": {
|
||||
return await getSAMLAuthUrlSS();
|
||||
|
Reference in New Issue
Block a user