From: TheSaminator Date: Mon, 7 Feb 2022 18:11:04 +0000 (-0500) Subject: Remove "Remember Me" checkbox X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=9e9c99ede29f7a0954006bd79aca8ec55b193d93;p=starship-fights Remove "Remember Me" checkbox --- diff --git a/src/jvmMain/kotlin/starshipfights/auth/providers.kt b/src/jvmMain/kotlin/starshipfights/auth/providers.kt index 53132ee..beb12b7 100644 --- a/src/jvmMain/kotlin/starshipfights/auth/providers.kt +++ b/src/jvmMain/kotlin/starshipfights/auth/providers.kt @@ -218,10 +218,8 @@ interface AuthProvider { object TestAuthProvider : AuthProvider { private const val USERNAME_KEY = "username" private const val PASSWORD_KEY = "password" - private const val REMEMBER_ME_KEY = "remember-me" private const val PASSWORD_VALUE = "very secure" - private const val REMEMBER_ME_VALUE = "yes" override fun installApplication(app: Application) { app.install(DoubleReceive) @@ -241,17 +239,11 @@ object TestAuthProvider : AuthProvider { User.put(it) } - val formParams = receiveOrNull() - val timeToRemember = if (formParams?.get(REMEMBER_ME_KEY) == REMEMBER_ME_VALUE) - 31_556_925_216L // 1 solar year - else - 3_600_000L // 1 hour - UserSession( user = user.id, clientAddresses = listOf(originAddress), userAgent = userAgent, - expirationMillis = System.currentTimeMillis() + timeToRemember + expirationMillis = System.currentTimeMillis() + 3_600_000L ).also { UserSession.put(it) } @@ -317,17 +309,6 @@ object TestAuthProvider : AuthProvider { +msg } } - p { - label { - htmlFor = REMEMBER_ME_KEY - checkBoxInput { - id = REMEMBER_ME_KEY - name = REMEMBER_ME_KEY - value = REMEMBER_ME_VALUE - } - +"Remember Me" - } - } submitInput { value = "Authenticate" }