oauth: delete session key instead of set to empty

Adds the Delete function to the Session wrapper so that the Macaron
function for deleting keys from a Session can be used.

https://go-macaron.com/docs/middlewares/session#implement-provider-interface
This commit is contained in:
Daniel Lee
2017-03-23 15:26:13 +01:00
parent 79cef75fed
commit beb85f413a
2 changed files with 10 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ func LoginView(c *middleware.Context) {
viewData.Settings["disableLoginForm"] = setting.DisableLoginForm
if loginError, ok := c.Session.Get("loginError").(string); ok {
c.Session.Set("loginError", "") // TODO: is there a proper way to delete a session var?
c.Session.Delete("loginError")
viewData.Settings["loginError"] = loginError
}