diff options
-rw-r--r-- | app/middleware/auth.go | 1 | ||||
-rw-r--r-- | templates/index.tpl | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/app/middleware/auth.go b/app/middleware/auth.go index 0a20a9e..b8bf7f9 100644 --- a/app/middleware/auth.go +++ b/app/middleware/auth.go | |||
@@ -217,7 +217,6 @@ func (m *AuthenticationMiddleware) HandleCompleteLogin(c echo.Context) error { | |||
217 | Path: "/", | 217 | Path: "/", |
218 | MaxAge: int(m.CookieDuration.Seconds()), | 218 | MaxAge: int(m.CookieDuration.Seconds()), |
219 | Secure: true, | 219 | Secure: true, |
220 | HttpOnly: true, | ||
221 | SameSite: http.SameSiteStrictMode, | 220 | SameSite: http.SameSiteStrictMode, |
222 | }) | 221 | }) |
223 | 222 | ||
diff --git a/templates/index.tpl b/templates/index.tpl index cbc7a72..2a5e853 100644 --- a/templates/index.tpl +++ b/templates/index.tpl | |||
@@ -174,9 +174,13 @@ | |||
174 | return document.cookie.match(new RegExp(name + "=\"?([^;\"]*)\"?;?"))[1]; | 174 | return document.cookie.match(new RegExp(name + "=\"?([^;\"]*)\"?;?"))[1]; |
175 | } | 175 | } |
176 | 176 | ||
177 | function parseJWTExpires(token) { | ||
178 | return new Date(JSON.parse(atob(token.split(".")[1]))["exp"] * 1000); | ||
179 | } | ||
180 | |||
177 | function populateAPIKey() { | 181 | function populateAPIKey() { |
178 | document.querySelector("#api-key textarea").innerText = getCookie("session"); | 182 | document.querySelector("#api-key textarea").innerText = "Bearer " + getCookie("github-token"); |
179 | document.querySelector("#session-expires").innerText = getCookie("session-expires"); | 183 | document.querySelector("#session-expires").innerText = parseJWTExpires(getCookie("github-token")); |
180 | } | 184 | } |
181 | 185 | ||
182 | window.addEventListener('load', populateAPIKey); | 186 | window.addEventListener('load', populateAPIKey); |