030
This commit is contained in:
parent
6343e590eb
commit
f0e5ee354d
2 changed files with 5 additions and 15 deletions
|
@ -14,6 +14,9 @@ import
|
|||
echo(fmt"[mike] before request: {ctx.httpMethod} {path2}")
|
||||
|
||||
"/" -> [get, post]:
|
||||
var
|
||||
user = parseJson(ctx.cookies.getOrDefault("user", ""))
|
||||
user2 = to(user, User)
|
||||
compileTemplateFile(getScriptDir() / "view" / "index.nimja")
|
||||
|
||||
"/shop" -> get:
|
||||
|
@ -45,6 +48,8 @@ import
|
|||
let conn=newTurso()
|
||||
var temp=getUser(conn, em, ps)
|
||||
if temp[0]:
|
||||
echo $(%* temp[1])
|
||||
ctx &= initCookie("user", $(%* temp[1]))
|
||||
ctx.redirect("/")
|
||||
else:
|
||||
echo "user not found"
|
||||
|
|
|
@ -10,32 +10,17 @@
|
|||
|
||||
<form id="input_form" method="post" class="" novalidate>
|
||||
|
||||
{# <!-- <label class="text-danger">{{loginError}}</label> --> #}
|
||||
<label class="text-danger"></label>
|
||||
<div class="form-group mt-5">
|
||||
<label for="email">Email:</label>
|
||||
{# <!-- <label class="text-danger">{{emailError}}</label> --> #}
|
||||
<label class="text-danger"></label>
|
||||
|
||||
{# <!-- {% if emailError != "" %}
|
||||
<input type="email" name="email" id="email" class="form-control is-invalid" required autocomplete="off">
|
||||
{% else %} --> #}
|
||||
<input type="email" name="email" id="email" class="form-control" required autocomplete="off" value="">
|
||||
{# <!-- {% endif %} --> #}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password:</label>
|
||||
{# <!-- <label class="text-danger">{{passwordError}}</label> --> #}
|
||||
<label class="text-danger"></label>
|
||||
|
||||
{# <!-- {% if passwordError != "" %}
|
||||
<input type="password" name="password" id="password" class="form-control is-invalid" required autocomplete="off">
|
||||
{% else %} --> #}
|
||||
<input type="password" name="password" id="password" class="form-control" required autocomplete="off" value="">
|
||||
{# <!-- {% endif %} --> #}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue