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

clippingkk / web / #1085

25 Apr 2025 03:38PM UTC coverage: 0.662%. Remained the same
#1085

push

AnnatarHe
fix(app): fix build issue and enable turbo build

30 of 389 branches covered (7.71%)

Branch coverage included in aggregate %.

0 of 6 new or added lines in 4 files covered. (0.0%)

146 existing lines in 13 files now uncovered.

148 of 26484 relevant lines covered (0.56%)

11.06 hits per line

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

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

×
5
export function middleware(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 (uid && !url.pathname.includes('callback') && url.searchParams.has('clean')) {
×
UNCOV
22
    request.cookies.delete(COOKIE_TOKEN_KEY)
×
UNCOV
23
    request.cookies.delete(USER_ID_KEY)
×
UNCOV
24
    return NextResponse.next()
×
UNCOV
25
  }
×
UNCOV
26
  const nextUrl = new URL(`/dash/${uid}/home`, request.url)
×
UNCOV
27
  nextUrl.protocol = url.protocol
×
UNCOV
28
  nextUrl.host = url.host
×
UNCOV
29
  nextUrl.port = url.port
×
UNCOV
30
  return NextResponse.redirect(nextUrl)
×
UNCOV
31
}
×
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