]> git.ipfire.org Git - people/ms/webapp.git/blobdiff - application/auth.py
Split into many seperate files.
[people/ms/webapp.git] / application / auth.py
diff --git a/application/auth.py b/application/auth.py
new file mode 100644 (file)
index 0000000..b8ea744
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+
+from handlers import BaseHandler
+
+class LoginHandler(BaseHandler):
+       def get(self):
+               self.render("login.html", footer=self.footer())
+
+       def post(self):
+               self.set_secure_cookie("user", self.get_argument("user"))
+               self.redirect("/")
+
+
+class LogoutHandler(BaseHandler):
+       def get(self):
+               self.clear_cookie("user")
+               self.render("logout.html", footer=self.footer())