Chat Interfaces

A Cursor-style agent workspace built entirely with Cubix AI components.

0 templates

Agent chat workspace

Fix auth redirect loop
The login page keeps bouncing back to itself after a successful sign-in. Trace the redirect and propose a fix.

The loop comes from middleware treating a brand-new session as anonymous for one request. After sign-in, callbackUrl still resolves to /login, so the next navigation bounces.

Prefer a stable post-auth destination and ignore login as a callback target:

lib/auth/resolve-post-auth-path.ts
export function resolvePostAuthPath(session: Session, callbackUrl?: string) {
  if (callbackUrl && !callbackUrl.startsWith("/login")) {
    return callbackUrl
  }

  return session.user.defaultWorkspace ?? "/dashboard"
}

Clear stale callback values on successful auth so login can never become the next hop.

Cursor-style agent shell with thinking, tool calls, code, actions, and Prompt Input.

Agent chat with sidebar

Fix auth redirect loop
The login page keeps bouncing back to itself after a successful sign-in. Trace the redirect and propose a fix.

Middleware treats a brand-new session as anonymous for one request. After sign-in, callbackUrl still resolves to /login, so navigation loops.

Prefer a stable post-auth destination and never allow login as a callback target:

lib/auth/resolve-post-auth-path.ts
export function resolvePostAuthPath(session: Session, callbackUrl?: string) {
  if (callbackUrl && !callbackUrl.startsWith("/login")) {
    return callbackUrl
  }

  return session.user.defaultWorkspace ?? "/dashboard"
}

Clear stale callback values on successful auth so login can never become the next hop.

Interactive agent workspace with resizable history sidebar, search, thread switching, and responsive overlay.