Skip to content

Commit c97de52

Browse files
committed
handle sign in directly (if using htpasswd)
1 parent 4367e47 commit c97de52

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

oauthproxy.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {

0 commit comments

Comments
 (0)