From a2abd97078f9652c8b1cce629ebc4ac090de3008 Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Mon, 6 May 2024 14:48:48 +0200 Subject: API auth: Return if err is not invalid tokens E.g. if refreshing fails here with a 500 or something else --- internal/api/api.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/api') diff --git a/internal/api/api.go b/internal/api/api.go index 804980f..a075153 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -107,6 +107,14 @@ func (a *API) authorize(ctx context.Context) (err error) { return nil } + // otherwise check if invalid tokens, + // if not then something else is wrong with the API + // return an error + tErr := &eduoauth.TokensInvalidError{} + if !errors.As(err, &tErr) { + return err + } + if a.Data.DisableAuthorize { return ErrAuthorizeDisabled } -- cgit v1.2.3