Proper Logout logic

This commit is contained in:
Maximilian 2022-11-01 17:29:41 -05:00
parent 2f3c12a06c
commit a6b6c259ce

View File

@ -2,6 +2,7 @@ package controllers
import ( import (
"GoWeb/app" "GoWeb/app"
"GoWeb/database/models"
"GoWeb/templating" "GoWeb/templating"
"net/http" "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) { 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)
} }