add logout

This commit is contained in:
kandrusyak
2023-07-28 01:48:49 +03:00
parent e55aea13b4
commit c90fa01388
2 changed files with 13 additions and 9 deletions

View File

@@ -5,7 +5,7 @@ import (
"astra-api-gateway/handler" "astra-api-gateway/handler"
"astra-api-gateway/mw" "astra-api-gateway/mw"
"astra-api-gateway/services/events" "astra-api-gateway/services/events"
medical_information "astra-api-gateway/services/medical-information" "astra-api-gateway/services/medical-information"
"astra-api-gateway/services/personal-information" "astra-api-gateway/services/personal-information"
"astra-api-gateway/services/store" "astra-api-gateway/services/store"
"astra-api-gateway/services/users" "astra-api-gateway/services/users"

View File

@@ -47,6 +47,8 @@ func Login(c echo.Context) (err error) {
Value: _token, Value: _token,
Path: "/", Path: "/",
Expires: time.Now().Add(24 * time.Hour), Expires: time.Now().Add(24 * time.Hour),
Secure: true,
SameSite: 4,
}) })
return c.JSON(http.StatusOK, u) return c.JSON(http.StatusOK, u)
@@ -58,6 +60,8 @@ func Logout(c echo.Context) error {
Value: "", Value: "",
Path: "/", Path: "/",
Expires: time.Unix(0, 0), Expires: time.Unix(0, 0),
Secure: true,
SameSite: 4,
}) })
return c.NoContent(http.StatusOK) return c.NoContent(http.StatusOK)
} }