From a6b6c259ce4a4cfc1f190c00decf6799dd47bf1d Mon Sep 17 00:00:00 2001 From: Maximilian Date: Tue, 1 Nov 2022 17:29:41 -0500 Subject: [PATCH] Proper Logout logic --- controllers/getController.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/getController.go b/controllers/getController.go index 5706d44..b09427a 100644 --- a/controllers/getController.go +++ b/controllers/getController.go @@ -2,6 +2,7 @@ package controllers import ( "GoWeb/app" + "GoWeb/database/models" "GoWeb/templating" "net/http" ) @@ -32,5 +33,6 @@ func (getController *GetController) ShowLogin(w http.ResponseWriter, r *http.Req } func (getController *GetController) Logout(w http.ResponseWriter, r *http.Request) { - templating.RenderTemplate(getController.App, w, "templates/pages/register.html", nil) + models.LogoutUser(getController.App, w, r) + http.Redirect(w, r, "/", http.StatusFound) }