generated from ITwrxOrg/EZ-Bkup
update copyright and clean up comments
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#[Copyright 2025 ITwrx.
|
||||
This file is part of Simple Site Manager.
|
||||
Simple Site Manager is released under the GNU Affero General Public License 3.0.
|
||||
This file is part of Forget-Me-Not.
|
||||
Forget-Me-Not is released under the GNU Affero General Public License 3.0.
|
||||
See COPYING or <https://www.gnu.org/licenses/> for details.]#
|
||||
|
||||
import guildenstern/httpserver
|
||||
@@ -23,7 +23,6 @@ proc loginPostHandler*() =
|
||||
#discard assignErrorFR(formErrors, formOldInputs, csrfTokenInput)
|
||||
discard assignErrorFR(formErrors, formOldInputs)
|
||||
let frJson = formResult.toJson()
|
||||
#let cookieHeader = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;"
|
||||
if APP_MODE == "dev":
|
||||
cookieHeader1 = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;" & "SameSite=Lax;"
|
||||
else:
|
||||
@@ -46,14 +45,6 @@ proc loginPostHandler*() =
|
||||
discard assignLoginSuccessFR()
|
||||
let frJson = formResult.toJson()
|
||||
#redirect, and set session cookie.
|
||||
#will probably need to detect requested url for redirect (with static fallback) instead of just static location.
|
||||
#Set-Cookie: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure; HttpOnly
|
||||
#dev
|
||||
#let cookieHeader1 = "Set-Cookie: " & APP_NAME & "_session=" & sessionId & ";" & "HttpOnly;" & "SameSite=Lax;"
|
||||
#let cookieHeader2 = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;" & "SameSite=Lax;"
|
||||
#prod
|
||||
#let cookieHeader1 = "Set-Cookie: " & APP_NAME & "_session=" & sessionId & ";" & "HttpOnly;" & "Secure=true;" & "SameSite=Lax;"
|
||||
#let cookieHeader2 = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "Secure=true;" & "path=/;" & "SameSite=Lax;"
|
||||
if APP_MODE == "dev":
|
||||
cookieHeader1 = "Set-Cookie: " & APP_NAME & "_session=" & sessionId & ";" & "HttpOnly;" & "SameSite=Lax;"
|
||||
cookieHeader2 = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;" & "SameSite=Lax;"
|
||||
@@ -74,8 +65,6 @@ proc loginPostHandler*() =
|
||||
formResult.errors = toJson(formErrors)
|
||||
formResult.oldInputs = getOldInputJson()
|
||||
let frJson = formResult.toJson()
|
||||
#let cookieHeader = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;"
|
||||
#let cookieHeader = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;"
|
||||
if APP_MODE == "dev":
|
||||
cookieHeader1 = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;" & "SameSite=Lax;"
|
||||
else:
|
||||
@@ -91,7 +80,6 @@ proc loginPostHandler*() =
|
||||
formResult.errors = toJson(formErrors)
|
||||
formResult.oldInputs = getOldInputJson()
|
||||
let frJson = formResult.toJson()
|
||||
#let cookieHeader = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;"
|
||||
if APP_MODE == "dev":
|
||||
cookieHeader1 = "Set-Cookie: form_result=" & frJson & ";" & "HttpOnly;" & "path=/;" & "SameSite=Lax;"
|
||||
else:
|
||||
@@ -100,7 +88,6 @@ proc loginPostHandler*() =
|
||||
|
||||
except Exception as e:
|
||||
echo e.msg
|
||||
#reply(Http500)
|
||||
discard assignGeneralErrorFR(e.msg)
|
||||
setFR()
|
||||
reply(Http303, [location("/500")])
|
||||
|
||||
Reference in New Issue
Block a user