{"version":3,"file":"sign-in-next-CAru-Mue-sec20261128.js","names":["MCP_OAUTH_CALLBACK_PATH","SLACK_INSTALL_CALLBACK_PATH","INVITE_PATH","signInNext","next","startsWith","test","newAccountDestination","MCP_OAUTH_CALLBACK_PATH","SLACK_INSTALL_CALLBACK_PATH","INVITE_PATH","signInNext","next","newAccountDestination"],"sources":["../../src/lib/auth/sign-in-next.ts"],"sourcesContent":["export const MCP_OAUTH_CALLBACK_PATH = \"/mcp/oauth/callback\";\nexport const SLACK_INSTALL_CALLBACK_PATH = \"/messaging/slack/callback\";\n\n// A Space invite link, or an organization invitation's Join page.\nconst INVITE_PATH = /^\\/(invite|join)\\/[A-Za-z0-9_-]{1,200}$/;\n\n/** The page sign-in or sign-up may return to; anything else is ignored, so `next` can't redirect off the app. */\nexport function signInNext(next: string | null): string | null {\n  if (!next) return null;\n  // A connector sign-in started on another device lands here signed out; finish it after sign-in.\n  if (\n    next === \"/integrations/setup\" ||\n    next === \"/admin/plugins\" ||\n    next === \"/admin/access\" ||\n    // The model-connection email opens the connect step.\n    next === \"/onboarding/model\" ||\n    next.startsWith(`${MCP_OAUTH_CALLBACK_PATH}?`) ||\n    next.startsWith(`${SLACK_INSTALL_CALLBACK_PATH}?`) ||\n    INVITE_PATH.test(next)\n  ) {\n    return next;\n  }\n  return null;\n}\n\n/** Where a new account starts: an invite it came for, otherwise onboarding. */\nexport function newAccountDestination(next: string | null): string {\n  return next && INVITE_PATH.test(next) ? next : \"/onboarding\";\n}\n"],"mappings":"AAAA,IAAaA,EAA0B,sBAC1BC,EAA8B,4BAGrCC,EAAc,0CAGpB,SAAgBC,EAAWC,EAAoC,CAe7D,OAdKA,IAGHA,IAAS,uBACTA,IAAS,kBACTA,IAAS,iBAETA,IAAS,qBACTA,EAAKC,WAAW,sBAA6B,GAC7CD,EAAKC,WAAW,4BAAiC,GACjDH,EAAYI,KAAKF,CAAI,GAEdA,EAZS,IAepB,CAGA,SAAgBG,EAAsBH,EAA6B,CACjE,OAAOA,GAAQF,EAAYI,KAAKF,CAAI,EAAIA,EAAO,aACjD,C"}