From cb5a8c1c2305c4633ecc5333ed20d9424ebc81f0 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Fri, 22 Dec 2023 17:46:57 +0000 Subject: [PATCH] accounts: position filter dropdown better for mobile --- auth.go | 6 ++-- html/admin.html | 70 ++++++++++++++++++++++-------------------- ts/admin.ts | 4 ++- ts/modules/accounts.ts | 2 +- ts/modules/common.ts | 28 +++++++++++++++++ 5 files changed, 72 insertions(+), 38 deletions(-) diff --git a/auth.go b/auth.go index 6ce4926..18230c9 100644 --- a/auth.go +++ b/auth.go @@ -233,7 +233,8 @@ func (app *appContext) getTokenLogin(gc *gin.Context) { respond(500, "Couldn't generate token", gc) return } - gc.SetCookie("refresh", refresh, (3600 * 24), "/", gc.Request.URL.Hostname(), true, true) + host := gc.Request.URL.Hostname() + gc.SetCookie("refresh", refresh, REFRESH_TOKEN_VALIDITY_SEC, "/", host, true, true) gc.JSON(200, getTokenDTO{token}) } @@ -297,6 +298,7 @@ func (app *appContext) getTokenRefresh(gc *gin.Context) { respond(500, "Couldn't generate token", gc) return } - gc.SetCookie("refresh", refresh, REFRESH_TOKEN_VALIDITY_SEC, "/", gc.Request.URL.Hostname(), true, true) + host := gc.Request.URL.Hostname() + gc.SetCookie("refresh", refresh, REFRESH_TOKEN_VALIDITY_SEC, "/", host, true, true) gc.JSON(200, getTokenDTO{jwt}) } diff --git a/html/admin.html b/html/admin.html index e34603a..51f3a6d 100644 --- a/html/admin.html +++ b/html/admin.html @@ -26,7 +26,7 @@ {{ template "login-modal.html" . }}