summaryrefslogtreecommitdiff
path: root/auth/cookie.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:38:40 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:38:40 +0200
commita9927763f43d59c418b264790ccee59defe8ca29 (patch)
tree5dfc4f1f1f29d1ef1cbca3406bf57d1667b93f76 /auth/cookie.go
parented23d402fec268e163ec895748f43e3254ba3dfd (diff)
refactor: Rename packages for clarityv0.3.0
Diffstat (limited to 'auth/cookie.go')
-rw-r--r--auth/cookie.go21
1 files changed, 0 insertions, 21 deletions
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: "/",
- }
-}