Ver código fonte

Add option to 'logout' and forget auth

oz123 10 anos atrás
pai
commit
5c85403104
2 arquivos alterados com 13 adições e 0 exclusões
  1. 3 0
      pwman/ui/templates/main.tpl
  2. 10 0
      scripts/webui.py

+ 3 - 0
pwman/ui/templates/main.tpl

@@ -17,3 +17,6 @@
   </tr>
 %end
 </table>
+<form action="/forget" method="POST">
+<input type="submit" value="Forget password">
+</form>

+ 10 - 0
scripts/webui.py

@@ -85,6 +85,16 @@ def edit_node(no=None):
     return output
 
 
+@route('/forget', method=['GET', 'POST'])
+def forget():
+    global AUTHENTICATED
+    AUTHENTICATED = False
+    enc = CryptoEngine.get()
+    enc.forget()
+
+    redirect('/auth')
+
+
 @route('/auth', method=['GET', 'POST'])
 def is_authenticated():
     global AUTHENTICATED