summaryrefslogtreecommitdiff
path: root/auth.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--auth.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/auth.go b/auth.go
index 14cd6d7..7be1c1e 100644
--- a/auth.go
+++ b/auth.go
@@ -106,6 +106,7 @@ type User struct {
Password string `form:"type=password;options=required"`
RememberMe bool `form:"type=checkbox;value=y;options=checked"`
Errors []error `form:"-"`
+ Csrf
}
func showLoginPage(w http.ResponseWriter, u User) {
@@ -117,7 +118,9 @@ func loginPage() http.HandlerFunc {
if session(r).Authenticated {
http.Redirect(w, r, "/", http.StatusFound)
}
- showLoginPage(w, User{})
+ showLoginPage(w, User{
+ Csrf: CsrfField(r),
+ })
}
}