UPDATE: Fix cookie
All checks were successful
Build and Release / release (push) Successful in 59s

This commit is contained in:
2026-03-31 10:58:05 +07:00
parent 338f6da83c
commit 8e2dcb817f
20 changed files with 407 additions and 195 deletions

View File

@@ -60,7 +60,7 @@ func (h *AuthController) Signin(c fiber.Ctx) error {
Value: res.AccessToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
c.Cookie(&fiber.Cookie{
@@ -68,7 +68,7 @@ func (h *AuthController) Signin(c fiber.Ctx) error {
Value: res.RefreshToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
return c.Status(fiber.StatusOK).JSON(response.CommonResponse{
@@ -113,7 +113,7 @@ func (h *AuthController) Signup(c fiber.Ctx) error {
Value: res.AccessToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
c.Cookie(&fiber.Cookie{
@@ -121,7 +121,7 @@ func (h *AuthController) Signup(c fiber.Ctx) error {
Value: res.RefreshToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
return c.Status(fiber.StatusOK).JSON(response.CommonResponse{
@@ -158,7 +158,7 @@ func (h *AuthController) RefreshToken(c fiber.Ctx) error {
Value: res.AccessToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
c.Cookie(&fiber.Cookie{
@@ -166,7 +166,7 @@ func (h *AuthController) RefreshToken(c fiber.Ctx) error {
Value: res.RefreshToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
return c.Status(fiber.StatusOK).JSON(response.CommonResponse{
@@ -306,7 +306,7 @@ func (h *AuthController) GoogleLogin(c fiber.Ctx) error {
Expires: time.Now().Add(15 * time.Minute),
HTTPOnly: true,
Secure: secure,
SameSite: "Lax",
SameSite: "None",
})
url := h.oauth.AuthCodeURL(state)
@@ -375,7 +375,7 @@ func (h *AuthController) GoogleCallback(c fiber.Ctx) error {
Value: res.AccessToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
c.Cookie(&fiber.Cookie{
@@ -383,7 +383,7 @@ func (h *AuthController) GoogleCallback(c fiber.Ctx) error {
Value: res.RefreshToken,
HTTPOnly: true,
Secure: c.Protocol() == "https",
SameSite: "Lax",
SameSite: "None",
})
return c.Redirect().To("http://localhost:5500")