git.iko.soy/typeable/oauth2-proxy
on master help sign in
handle sign in directly (if using htpasswd)
commitc97de52200d43a93d2e27eb67cd7aaef5f82b097 authorJehiah Czebotar <jehiah@gmail.com> dateWed 26 Dec 2012, 10:35 (14 years ago) parent4367e47
1 file changed+8−8
oauthproxy.go+8−8
oauthproxy.go+8−8
@@ -201,19 +201,19 @@ func (p *OauthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code
201201 p.ClearCookie(rw, req)
202202 rw.WriteHeader(code)
203203 templates := getTemplates()
204−
205− t := struct{
204+
205+ t := struct {
206206 SignInMessage string
207− Htpasswd bool
207+ Htpasswd bool
208208 }{
209− SignInMessage: p.SignInMessage,
210− Htpasswd: p.HtpasswdFile != nil,
209+ SignInMessage: p.SignInMessage,
210+ Htpasswd: p.HtpasswdFile != nil,
211211 }
212212 templates.ExecuteTemplate(rw, "sign_in.html", t)
213213}
214214
215−func (p *OauthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool){
216− if req.Method != "POST" || p.HtpasswdFile == nil{
215+func (p *OauthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool) {
216+ if req.Method != "POST" || p.HtpasswdFile == nil {
217217 return "", false
218218 }
219219 user := req.FormValue("username")
@@ -236,7 +236,7 @@ func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
236236 remoteIP = req.RemoteAddr
237237 }
238238 log.Printf("%s %s %s", remoteIP, req.Method, req.URL.Path)
239−
239+
240240 var ok bool
241241 var user string
242242 if req.URL.Path == signInPath {