Repository: miniflux/v2 (language: go)

Issue:
Hide the logout link when using auth proxy
When using auth proxy, logout is essentially no-op. Currently, it can be hidden with this custom CSS:

```
/* Hide logout link. */
nav li:last-child {
  display: none;
}
```

I think we should hide it.


Discussion / hints:

Fix patch:
diff --git a/template/functions.go b/template/functions.go
index c32e8b3ebf2..4b21111d671 100644
--- a/template/functions.go
+++ b/template/functions.go
@@ -45,6 +45,9 @@ func (f *funcMap) Map() template.FuncMap {
 		"hasOAuth2Provider": func(provider string) bool {
 			return config.Opts.OAuth2Provider() == provider
 		},
+		"hasAuthProxy": func() bool {
+			return config.Opts.AuthProxyHeader() != ""
+		},
 		"route": func(name string, args ...interface{}) string {
 			return route.Path(f.router, name, args...)
 		},
diff --git a/template/templates/common/layout.html b/template/templates/common/layout.html
index b57503860af..3eceb4dc591 100644
--- a/template/templates/common/layout.html
+++ b/template/templates/common/layout.html
@@ -82,9 +82,11 @@
                 <li {{ if eq .menu "settings" }}class="active"{{ end }} title="{{ t "tooltip.keyboard_shortcuts" "g s" }}">
                     <a href="{{ route "settings" }}" data-page="settings">{{ t "menu.settings" }}</a>
                 </li>
-                <li>
-                    <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ t "menu.logout" }}</a>
-                </li>
+                {{ if not hasAuthProxy }}
+                    <li>
+                        <a href="{{ route "logout" }}" title="{{ t "tooltip.logged_user" .user.Username }}">{{ t "menu.logout" }}</a>
+                    </li>
+                {{ end }}
             </ul>
             <div class="search">
                 <div class="search-toggle-switch {{ if $.searchQuery }}has-search-query{{ end }}">


Test patch: