]> source.dussan.org Git - gitea.git/commitdiff
Fix SSPI auth panic (#25955)
authorwxiaoguang <wxiaoguang@gmail.com>
Tue, 18 Jul 2023 17:32:49 +0000 (01:32 +0800)
committerGitHub <noreply@github.com>
Tue, 18 Jul 2023 17:32:49 +0000 (17:32 +0000)
Try to fix #25952

Co-authored-by: Giteabot <teabot@gitea.io>
services/auth/sspi_windows.go

index c162810797c84c7bf711ffeb8822637156d6e74f..eabfd5fa41bd04bdbf6f35872a5c733aceab30ec 100644 (file)
@@ -89,9 +89,9 @@ func (s *SSPI) Verify(req *http.Request, w http.ResponseWriter, store DataStore,
                }
                store.GetData()["EnableOpenIDSignIn"] = setting.Service.EnableOpenIDSignIn
                store.GetData()["EnableSSPI"] = true
-               // in this case, the store is Gitea's web Context
+               // in this case, the Verify function is called in Gitea's web context
                // FIXME: it doesn't look good to render the page here, why not redirect?
-               store.(*gitea_context.Context).HTML(http.StatusUnauthorized, tplSignIn)
+               gitea_context.GetWebContext(req).HTML(http.StatusUnauthorized, tplSignIn)
                return nil, err
        }
        if outToken != "" {