Proper Logout logic
This commit is contained in:
parent
2f3c12a06c
commit
a6b6c259ce
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user