providers/proxy: fix duplicate proxy set default

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-08-18 21:10:35 +02:00
parent 514c48a986
commit 0cc83c23c4
3 changed files with 5 additions and 9 deletions

View File

@ -477,7 +477,7 @@ class OAuthFulfillmentStage(StageView):
GrantTypes.HYBRID, GrantTypes.HYBRID,
]: ]:
code = self.params.create_code(self.request) code = self.params.create_code(self.request)
code.save(force_insert=True) code.save()
if self.params.response_mode == ResponseMode.QUERY: if self.params.response_mode == ResponseMode.QUERY:
query_params = parse_qs(uri.query) query_params = parse_qs(uri.query)

View File

@ -9,9 +9,3 @@ class AuthentikProviderProxyConfig(ManagedAppConfig):
label = "authentik_providers_proxy" label = "authentik_providers_proxy"
verbose_name = "authentik Providers.Proxy" verbose_name = "authentik Providers.Proxy"
default = True default = True
def reconcile_trigger_proxy_set_defaults(self):
"""Trigger set_defaults task"""
from authentik.providers.proxy.tasks import proxy_set_defaults
proxy_set_defaults.delay()

View File

@ -148,9 +148,11 @@ func NewApplication(p api.ProxyOutpostConfig, c *http.Client, cs *ak.CryptoStore
mux.Use(sentryhttp.New(sentryhttp.Options{}).Handle) mux.Use(sentryhttp.New(sentryhttp.Options{}).Handle)
mux.Use(func(inner http.Handler) http.Handler { mux.Use(func(inner http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if _, set := r.URL.Query()[CallbackSignature]; set { if strings.EqualFold(r.URL.Query().Get(CallbackSignature), "true") {
a.log.Debug("handling OAuth Callback from querystring signature")
a.handleAuthCallback(w, r) a.handleAuthCallback(w, r)
} else if _, set := r.URL.Query()[LogoutSignature]; set { } else if strings.EqualFold(r.URL.Query().Get(LogoutSignature), "true") {
a.log.Debug("handling OAuth Logout from querystring signature")
a.handleSignOut(w, r) a.handleSignOut(w, r)
} else { } else {
inner.ServeHTTP(w, r) inner.ServeHTTP(w, r)