summaryrefslogtreecommitdiff
path: root/internal/api/api.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-07-08 09:18:10 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-07-17 14:00:03 +0000
commitdd61cd1f935930850986510675a2c37f0e85ef27 (patch)
treec90a058fec98046e802fdd8c1f37b9289118ff77 /internal/api/api.go
parentcb8e2a5ae27aa34f2a9ad21469538403274e3b3e (diff)
Client + API: Mark organizations expired *before* processing url
Diffstat (limited to 'internal/api/api.go')
-rw-r--r--internal/api/api.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/api/api.go b/internal/api/api.go
index 16f86af..6cba35c 100644
--- a/internal/api/api.go
+++ b/internal/api/api.go
@@ -44,7 +44,7 @@ type ServerData struct {
// BaseAuthWK is the base well-known endpoint for authorization. This is only different in case of secure internet
BaseAuthWK string
// ProcessAuth processes the OAuth authorization
- ProcessAuth func(string) string
+ ProcessAuth func(context.Context, string) (string, error)
// DisableAuthorize indicates whether or not new authorization requests should be disabled
DisableAuthorize bool
// Transport is the HTTP transport, only used for testing currently
@@ -134,7 +134,10 @@ func (a *API) authorize(ctx context.Context) (err error) {
return err
}
if a.Data.ProcessAuth != nil {
- url = a.Data.ProcessAuth(url)
+ url, err = a.Data.ProcessAuth(ctx, url)
+ if err != nil {
+ return err
+ }
}
// We expect an uri if custom redirect is non empty
uri, err := a.cb.TriggerAuth(ctx, url, a.oauth.CustomRedirect != "")