@@ -51,6 +51,7 @@ import {
51
51
redirectWithErrorMessage ,
52
52
redirectWithSuccessMessage ,
53
53
getSession ,
54
+ commitSession ,
54
55
} from "~/models/message.server" ;
55
56
import { findProjectBySlug } from "~/models/project.server" ;
56
57
import { DeleteProjectService } from "~/services/deleteProject.server" ;
@@ -94,14 +95,20 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
94
95
95
96
const session = await getSession ( request . headers . get ( "Cookie" ) ) ;
96
97
const openGitHubRepoConnectionModal = session . get ( "gitHubAppInstalled" ) === true ;
98
+ const headers = new Headers ( {
99
+ "Set-Cookie" : await commitSession ( session ) ,
100
+ } ) ;
97
101
98
102
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
+ ) ;
105
112
}
106
113
107
114
const userId = await requireUserId ( request ) ;
@@ -140,15 +147,20 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
140
147
connectedGithubRepository . branchTracking
141
148
) ;
142
149
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,
148
161
} ,
149
- githubAppInstallations : undefined ,
150
- openGitHubRepoConnectionModal,
151
- } ) ;
162
+ { headers }
163
+ ) ;
152
164
}
153
165
154
166
const githubAppInstallations = await prisma . githubAppInstallation . findMany ( {
@@ -182,12 +194,15 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
182
194
} ,
183
195
} ) ;
184
196
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
+ ) ;
191
206
} ;
192
207
193
208
const ConnectGitHubRepoFormSchema = z . object ( {
0 commit comments