Skip to content

Commit 4ac5faa

Browse files
authored
fix(sast): fix codeql SAST warning (#2933)
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
1 parent 41aadb4 commit 4ac5faa

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • app/controlplane/internal/service

app/controlplane/internal/service/auth.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,15 @@ func generateUserJWT(userID, passphrase string, expiration time.Duration) (strin
434434
}
435435

436436
func setOauthCookie(w http.ResponseWriter, name, value string) {
437-
http.SetCookie(w, &http.Cookie{Name: name, Value: value, Path: "/", Expires: time.Now().Add(10 * time.Minute)})
437+
http.SetCookie(w, &http.Cookie{
438+
Name: name,
439+
Value: value,
440+
Path: "/",
441+
Expires: time.Now().Add(10 * time.Minute),
442+
HttpOnly: true,
443+
Secure: true,
444+
SameSite: http.SameSiteLaxMode,
445+
})
438446
}
439447

440448
func generateAndLogDevUser(userUC *biz.UserUseCase, log *log.Helper, authConfig *conf.Auth) error {

0 commit comments

Comments
 (0)