From c4bdb74a71d43599c6f033595339da1ab4a7dff3 Mon Sep 17 00:00:00 2001 From: Scott Ostler Date: Sat, 4 Sep 2010 04:34:15 -0400 Subject: switch login/logout to be POSTs --- src/site.clj | 5 +- static/js/home.js | 2 +- template/banner.st | 164 ++++++++++++++++++++++++++--------------------------- 3 files changed, 87 insertions(+), 84 deletions(-) diff --git a/src/site.clj b/src/site.clj index 7806d7b..d692849 100644 --- a/src/site.clj +++ b/src/site.clj @@ -1212,9 +1212,12 @@ WHERE u.user_id = ANY(?)" (GET "/u/:nick/:offset" (redirect-to (str "/" (params :nick)))) (GET "/p/:nick/:postid" (single-message session (params :nick) (params :postid))) - ;; TODO: these shouldn't be GETs + + ;; TODO: delete GET routes very shortly (GET "/login" (login session params cookies request)) + (POST "/login" (login session params cookies request)) (GET "/logout" (logout session)) + (POST "/logout" (logout session)) (GET "/register" (serve-static "static" "register.html")) (GET "/registerdis" (serve-static "static" "registerdis.html")) (GET "/browser" (browser session)) diff --git a/static/js/home.js b/static/js/home.js index db2d428..736fc84 100755 --- a/static/js/home.js +++ b/static/js/home.js @@ -161,7 +161,7 @@ function login() { }; $.ajax({ - type: 'GET', + type: 'POST', timeout: 5000, url: '/login', data: {'nick': nick, ts: '', 'hash': hash, 'rememberme': rememberme}, diff --git a/template/banner.st b/template/banner.st index eb7f0a9..d032a19 100644 --- a/template/banner.st +++ b/template/banner.st @@ -8,104 +8,104 @@
- $if(!user_nick)$ -
$else$ -
- $endif$ -
-
- $if(user_nick)$ - - - + $if(!user_nick)$ +
+ $else$ +
+ $endif$ +
+
+ $if(user_nick)$ + + + - Profile - - Directory - - - Hall of Fame - - - Favs - Image Search + Profile + + Directory + + + Hall of Fame + + + Favs + Image Search -
-
- + + + + + + + + + + + + + - -
-
+ + +
- - $else$ - Register - $endif$ -
+ + $else$ + Register + $endif$ +
+
-
+
-
- - $if(user_nick)$ - + + $if(user_nick)$ + -