From fd39dbff0fea214305ff983be0b3d0ff975581b8 Mon Sep 17 00:00:00 2001 From: rav4s Date: Fri, 18 Dec 2020 11:07:33 -0600 Subject: [PATCH] Added logout function --- garage_door_script.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/garage_door_script.py b/garage_door_script.py index 7092b4d..62b7ba8 100644 --- a/garage_door_script.py +++ b/garage_door_script.py @@ -71,6 +71,14 @@ def cookie(): else: return 'Not logged in.' +# Route for the logout page +@app.route('/logout') +def logout(): + resp = make_response('/login') + resp.set_cookie('logged_in', expires=0) + return resp + +# Route for the favicon @app.route('/favicon.ico') def favicon(): return send_from_directory(os.path.join(app.root_path, 'static'),