File tree Expand file tree Collapse file tree
app/api/public/transcripts/[guild]/[id] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { SIDEBAR_COOKIE_MAX_AGE , SIDEBAR_COOKIE_NAME } from "@/components/unity/team-switcher"
2+ import { BASE_URI , USE_HTTPS } from "@/lib/definitions"
3+ import { NextResponse } from "next/server"
4+
5+
6+ async function GetTranscript ( req : Request ,
7+ { params } : { params : Promise < { id : string , guild : string } > }
8+ ) {
9+
10+ const { id, guild } = ( await params )
11+
12+ const response = NextResponse . redirect ( `http${ USE_HTTPS ? 's' : '' } ://${ BASE_URI } /dashboard/transcripts/${ id } ` )
13+
14+ response . cookies . set ( {
15+ name : SIDEBAR_COOKIE_NAME ,
16+ value : guild ,
17+ maxAge : SIDEBAR_COOKIE_MAX_AGE ,
18+ httpOnly : true ,
19+ sameSite : "strict" ,
20+ } ) ;
21+
22+ return response
23+
24+ }
25+
26+
27+ export {
28+ GetTranscript as GET
29+ }
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ import { useBackend } from "@/hooks/use-backend"
3131import { useSelectedGuildState } from "@/hooks/use-selected-guild-state"
3232import { useSearchParams } from "next/navigation"
3333
34- const SIDEBAR_COOKIE_NAME = "sidebar-guild"
35- const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
34+ export const SIDEBAR_COOKIE_NAME = "sidebar-guild"
35+ export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 30
3636
3737export function TeamSwitcher ( {
3838 teams,
You can’t perform that action at this time.
0 commit comments