-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirect with query param #2811
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,6 @@ | |
router as token_rate_limit_settings_router, | ||
) | ||
from danswer.setup import setup_danswer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Removal of |
||
from danswer.setup import setup_multitenant_danswer | ||
from danswer.utils.logger import setup_logger | ||
from danswer.utils.telemetry import get_or_generate_uuid | ||
from danswer.utils.telemetry import optional_telemetry | ||
|
@@ -176,12 +175,10 @@ async def lifespan(app: FastAPI) -> AsyncGenerator: | |
# We cache this at the beginning so there is no delay in the first telemetry | ||
get_or_generate_uuid() | ||
|
||
# If we are multi-tenant, we need to only set up initial public tables | ||
with Session(engine) as db_session: | ||
setup_danswer(db_session) | ||
|
||
else: | ||
setup_multitenant_danswer() | ||
|
||
optional_telemetry(record_type=RecordType.VERSION, data={"version": __version__}) | ||
yield | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ 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"; | ||
import { getSecondsUntilExpiration } from "@/lib/time"; | ||
import AuthFlowContainer from "@/components/auth/AuthFlowContainer"; | ||
|
@@ -37,6 +37,10 @@ const Page = async ({ | |
console.log(`Some fetch failed for the login page - ${e}`); | ||
} | ||
|
||
const nextUrl = Array.isArray(searchParams?.next) | ||
? searchParams?.next[0] | ||
: searchParams?.next || null; | ||
|
||
// simply take the user to the home page if Auth is disabled | ||
if (authTypeMetadata?.authType === "disabled") { | ||
return redirect("/"); | ||
|
@@ -59,7 +63,7 @@ const Page = async ({ | |
let authUrl: string | null = null; | ||
if (authTypeMetadata) { | ||
try { | ||
authUrl = await getAuthUrlSS(authTypeMetadata.authType); | ||
authUrl = await getAuthUrlSS(authTypeMetadata.authType, nextUrl!); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Using non-null assertion (!). Consider adding a null check for nextUrl instead. |
||
} catch (e) { | ||
console.log(`Some fetch failed for the login page - ${e}`); | ||
} | ||
|
@@ -88,6 +92,7 @@ const Page = async ({ | |
/> | ||
</> | ||
)} | ||
|
||
{authTypeMetadata?.authType === "basic" && ( | ||
<Card className="mt-4 w-96"> | ||
<div className="flex"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Copying response attributes may expose sensitive information. Ensure only necessary data is transferred