MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / redirect

Function redirect

packages/web/src/auth.ts:334–348  ·  view source on GitHub ↗
({ url, baseUrl })

Source from the content-addressed store, hash-verified

332 // is visible in code and not dependent on upstream defaults.
333 // @see https://authjs.dev/reference/core#redirect
334 async redirect({ url, baseUrl }) {
335 if (url.startsWith("/")) {
336 return `${baseUrl}${url}`;
337 }
338
339 try {
340 if (new URL(url).origin === baseUrl) {
341 return url;
342 }
343 } catch {
344 // Malformed URL — fall through to baseUrl.
345 }
346
347 return baseUrl;
348 },
349 async jwt({ token, user: _user }) {
350 const user = _user as User | undefined;
351 // @note: `user` will be available on signUp or signIn triggers.

Callers 13

authenticatedPageFunction · 0.85
RedeemPageFunction · 0.85
InvitePageFunction · 0.85
AuthorizePageFunction · 0.85
LayoutFunction · 0.85
AskGHLayoutFunction · 0.85
SettingsPageFunction · 0.85
SettingsLayoutFunction · 0.85
page.tsxFile · 0.85
SignupFunction · 0.85
OnboardingFunction · 0.85
LoginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected