From a9927763f43d59c418b264790ccee59defe8ca29 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 24 Oct 2023 08:38:40 +0200 Subject: refactor: Rename packages for clarity --- auth/cookie.go | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 auth/cookie.go (limited to 'auth/cookie.go') diff --git a/auth/cookie.go b/auth/cookie.go deleted file mode 100644 index 61349fa..0000000 --- a/auth/cookie.go +++ /dev/null @@ -1,21 +0,0 @@ -package auth - -import ( - "fmt" - "net/http" - "time" - - "github.com/martinlehoux/kagamigo/core" -) - -func CraftCookie(id core.ID, config AuthConfig) http.Cookie { - expiresAt := time.Now().Add(24 * time.Hour) - cookieValue := encrypt(config.CookieSecret, fmt.Sprintf("%s:%d", id.String(), expiresAt.Unix())) - return http.Cookie{ - Domain: config.Domain, - Name: "authentication", - Value: cookieValue, - Expires: expiresAt, - Path: "/", - } -} -- cgit v1.3