Skip to content

Commit

Permalink
fix: enable cookie post
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Urban committed Apr 30, 2024
1 parent b08d0b9 commit 369797e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/internal/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ func (h *Handler) HandleLogin(w http.ResponseWriter, r *http.Request) {
slog.Error("could not extract Main Domain", err)
return
}
slog.Info("Domain: ", domain)
// Set the token as a cookie
http.SetCookie(w, &http.Cookie{
Name: "X-Auth-Token",
Value: tokenString,
Expires: time.Now().Add(24 * time.Hour),
Secure: true, // Set this to true if using HTTPS
SameSite: http.SameSiteNoneMode, // Set this to true if using HTTPS
Domain: domain, // Adjust to your domain
Domain: r.Host, // Adjust to your domain
Path: "/",
})

Expand Down

0 comments on commit 369797e

Please sign in to comment.