From b03bd4b7c4a3ae17498c4c5d6f602978fabf3f9f Mon Sep 17 00:00:00 2001 From: Sam Dodrill Date: Wed, 7 Jan 2015 09:10:16 -0800 Subject: [PATCH] app: add page titles --- app.moon | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app.moon b/app.moon index 92f6855..9ceb677 100644 --- a/app.moon +++ b/app.moon @@ -40,13 +40,26 @@ class App extends lapis.Application @params.registrar_password = encoding.encode_base64 encoding.hmac_sha1(@params.email, os.time!) if Users\find email: @params.email + @title = "Failure" return status: 500, "User with that email already exists" user = Users\create @params user\write_session @ - @session.sippw = @params.registrar_password - "Hi " .. user.name + @title = "Success" + + @html -> + h1 "Success" + p -> + text "Your email is " .. user.email + p -> + text "Your extension is " .. user.id + p -> + text "Your sip password is " + code user.registrar_password + + p "This will not be shown again so please be sure to write this down." + } [login: "/login"]: capture_errors respond_to { @@ -68,8 +81,11 @@ class App extends lapis.Application if user.password == cmppass user\write_session @ + @title = "Login successful" + return "Hi " .. user.name else + @title = "Login failure" return status: 500, "bad password" }