@@ -51,6 +51,7 @@ import {
5151 redirectWithErrorMessage ,
5252 redirectWithSuccessMessage ,
5353 getSession ,
54+ commitSession ,
5455} from "~/models/message.server" ;
5556import { findProjectBySlug } from "~/models/project.server" ;
5657import { DeleteProjectService } from "~/services/deleteProject.server" ;
@@ -94,14 +95,20 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
9495
9596 const session = await getSession ( request . headers . get ( "Cookie" ) ) ;
9697 const openGitHubRepoConnectionModal = session . get ( "gitHubAppInstalled" ) === true ;
98+ const headers = new Headers ( {
99+ "Set-Cookie" : await commitSession ( session ) ,
100+ } ) ;
97101
98102 if ( ! githubAppEnabled ) {
99- return typedjson ( {
100- githubAppEnabled,
101- githubAppInstallations : undefined ,
102- connectedGithubRepository : undefined ,
103- openGitHubRepoConnectionModal,
104- } ) ;
103+ return typedjson (
104+ {
105+ githubAppEnabled,
106+ githubAppInstallations : undefined ,
107+ connectedGithubRepository : undefined ,
108+ openGitHubRepoConnectionModal,
109+ } ,
110+ { headers }
111+ ) ;
105112 }
106113
107114 const userId = await requireUserId ( request ) ;
@@ -140,15 +147,20 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
140147 connectedGithubRepository . branchTracking
141148 ) ;
142149
143- return typedjson ( {
144- githubAppEnabled,
145- connectedGithubRepository : {
146- ...connectedGithubRepository ,
147- branchTracking : branchTrackingOrFailure . success ? branchTrackingOrFailure . data : undefined ,
150+ return typedjson (
151+ {
152+ githubAppEnabled,
153+ connectedGithubRepository : {
154+ ...connectedGithubRepository ,
155+ branchTracking : branchTrackingOrFailure . success
156+ ? branchTrackingOrFailure . data
157+ : undefined ,
158+ } ,
159+ githubAppInstallations : undefined ,
160+ openGitHubRepoConnectionModal,
148161 } ,
149- githubAppInstallations : undefined ,
150- openGitHubRepoConnectionModal,
151- } ) ;
162+ { headers }
163+ ) ;
152164 }
153165
154166 const githubAppInstallations = await prisma . githubAppInstallation . findMany ( {
@@ -182,12 +194,15 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
182194 } ,
183195 } ) ;
184196
185- return typedjson ( {
186- githubAppEnabled,
187- githubAppInstallations,
188- connectedGithubRepository : undefined ,
189- openGitHubRepoConnectionModal,
190- } ) ;
197+ return typedjson (
198+ {
199+ githubAppEnabled,
200+ githubAppInstallations,
201+ connectedGithubRepository : undefined ,
202+ openGitHubRepoConnectionModal,
203+ } ,
204+ { headers }
205+ ) ;
191206} ;
192207
193208const ConnectGitHubRepoFormSchema = z . object ( {
0 commit comments