• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

clippingkk / web / #1183

10 Dec 2025 04:53PM UTC coverage: 0.526% (+0.006%) from 0.52%
#1183

push

web-flow
Merge b5c98262e into b46e895d7

30 of 446 branches covered (6.73%)

Branch coverage included in aggregate %.

2 of 394 new or added lines in 116 files covered. (0.51%)

35 existing lines in 8 files now uncovered.

147 of 33222 relevant lines covered (0.44%)

8.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/proxy.ts
1
import type { NextRequest } from 'next/server'
×
2
import { NextResponse } from 'next/server'
×
3
import { COOKIE_TOKEN_KEY, USER_ID_KEY } from './constants/storage'
×
4

×
NEW
5
export function proxy(request: NextRequest) {
×
6
  const url = new URL(request.url)
×
7

×
8
  if (!url.pathname.startsWith('/auth')) {
×
9
    return NextResponse.next()
×
10
  }
×
11

×
12
  if (!request.cookies.has(COOKIE_TOKEN_KEY)) {
×
13
    return NextResponse.next()
×
14
  }
×
15

×
16
  // If going to the authentication page but already having a token and UID, just redirect to my home page.
×
17
  const uid = request.cookies.get(USER_ID_KEY)?.value
×
18
  if (!uid) {
×
19
    return NextResponse.next()
×
20
  }
×
21
  if (
×
22
    uid &&
×
23
    !url.pathname.includes('callback') &&
×
24
    url.searchParams.has('clean')
×
25
  ) {
×
26
    request.cookies.delete(COOKIE_TOKEN_KEY)
×
27
    request.cookies.delete(USER_ID_KEY)
×
28
    return NextResponse.next()
×
29
  }
×
30
  const nextUrl = new URL(`/dash/${uid}/home`, request.url)
×
31
  nextUrl.protocol = url.protocol
×
32
  nextUrl.host = url.host
×
33
  nextUrl.port = url.port
×
34
  return NextResponse.redirect(nextUrl)
×
35
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc