@@ -165,7 +165,14 @@ func (a *Admin) handleGitHubCallback(c *gin.Context) {
165
165
166
166
randomKey := random .String (32 )
167
167
tokens [randomKey ] = * token
168
- c .SetCookie ("ghtoken" , randomKey , int (time .Hour .Seconds ()), "/" , "localhost" , true , true )
168
+
169
+ domain := "localhost"
170
+
171
+ if a .Mode == server .ProductionMode {
172
+ domain = "benchmark.vitess.io"
173
+ }
174
+
175
+ c .SetCookie ("ghtoken" , randomKey , int (time .Hour .Seconds ()), "/" , domain , true , true )
169
176
170
177
c .Redirect (http .StatusSeeOther , "/admin/dashboard" )
171
178
} else {
@@ -253,6 +260,10 @@ func (a *Admin) handleExecutionsAdd(c *gin.Context) {
253
260
254
261
serverAPIURL := "http://localhost:8080/api/executions/add"
255
262
263
+ if a .Mode == server .ProductionMode {
264
+ serverAPIURL = "https://benchmark.vitess.io/api/executions/add"
265
+ }
266
+
256
267
req , err := http .NewRequest ("POST" , serverAPIURL , bytes .NewBuffer (jsonData ))
257
268
258
269
if err != nil {
@@ -275,11 +286,11 @@ func (a *Admin) handleExecutionsAdd(c *gin.Context) {
275
286
276
287
defer resp .Body .Close ()
277
288
278
- if resp .StatusCode != http .StatusOK {
289
+ if resp .StatusCode != http .StatusCreated {
279
290
slog .Error ("Server API returned an error: " , resp .Status )
280
291
c .JSON (resp .StatusCode , gin.H {"error" : "Failed to process request on server API" })
281
292
return
282
293
}
283
294
284
- c .JSON (http .StatusOK , gin.H {"message" : "Execution(s) added successfully" })
295
+ c .JSON (http .StatusCreated , gin.H {"message" : "Execution(s) added successfully" })
285
296
}
0 commit comments