pulled out sqlite3 for json
This commit is contained in:
+6
-6
@@ -15,12 +15,12 @@ func homeHandler(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
func loginHandler(w http.ResponseWriter, req *http.Request) {
|
||||
pwAttempt := req.FormValue("passwd")
|
||||
if check_password(pwAttempt) {
|
||||
session, _ := store.Get(req, "creds")
|
||||
session.Values["logged in"] = true
|
||||
session.Save(req, w)
|
||||
if check_password(*passes_file, pwAttempt) {
|
||||
session, _ := store.Get(req, "creds")
|
||||
session.Values["logged in"] = true
|
||||
session.Save(req, w)
|
||||
http.Redirect(w, req, "/", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
T("login.html").Execute(w, map[string]interface{}{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user