summaryrefslogtreecommitdiff
path: root/kauth/cookie.go
diff options
context:
space:
mode:
Diffstat (limited to 'kauth/cookie.go')
-rw-r--r--kauth/cookie.go21
1 files changed, 0 insertions, 21 deletions
diff --git a/kauth/cookie.go b/kauth/cookie.go
deleted file mode 100644
index edc30b7..0000000
--- a/kauth/cookie.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package kauth
-
-import (
- "fmt"
- "net/http"
- "time"
-
- "github.com/martinlehoux/kagamigo/kcore"
-)
-
-func CraftCookie(id kcore.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: "/",
- }
-}