2024-10-05 21:08:02 +01:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
2024-10-25 15:08:56 +01:00
|
|
|
auth2 "github.com/1f349/lavender/auth"
|
2024-10-05 21:08:02 +01:00
|
|
|
"github.com/julienschmidt/httprouter"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2024-10-25 15:08:56 +01:00
|
|
|
func (h *httpServer) logoutPost(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, _ auth2.UserAuth) {
|
2024-10-05 21:08:02 +01:00
|
|
|
http.SetCookie(rw, &http.Cookie{
|
|
|
|
Name: "lavender-login-access",
|
|
|
|
Path: "/",
|
|
|
|
MaxAge: -1,
|
|
|
|
Secure: true,
|
|
|
|
SameSite: http.SameSiteLaxMode,
|
|
|
|
})
|
|
|
|
http.SetCookie(rw, &http.Cookie{
|
|
|
|
Name: "lavender-login-refresh",
|
|
|
|
Path: "/",
|
|
|
|
MaxAge: -1,
|
|
|
|
Secure: true,
|
|
|
|
SameSite: http.SameSiteLaxMode,
|
|
|
|
})
|
|
|
|
|
|
|
|
http.Redirect(rw, req, "/", http.StatusFound)
|
|
|
|
}
|