handle sign in directly (if using htpasswd)

This commit is contained in:
Jehiah Czebotar 2012-12-26 10:35:02 -05:00
parent 4367e47a46
commit c97de52200

View File

@ -202,18 +202,18 @@ func (p *OauthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code
rw.WriteHeader(code)
templates := getTemplates()
t := struct{
t := struct {
SignInMessage string
Htpasswd bool
Htpasswd bool
}{
SignInMessage: p.SignInMessage,
Htpasswd: p.HtpasswdFile != nil,
Htpasswd: p.HtpasswdFile != nil,
}
templates.ExecuteTemplate(rw, "sign_in.html", t)
}
func (p *OauthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool){
if req.Method != "POST" || p.HtpasswdFile == nil{
func (p *OauthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool) {
if req.Method != "POST" || p.HtpasswdFile == nil {
return "", false
}
user := req.FormValue("username")