diff options
| author | Jeroen Wijenbergh <jeroenwijenbergh@protonmail.com> | 2024-05-06 14:48:48 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-05-24 13:25:11 +0200 |
| commit | a2abd97078f9652c8b1cce629ebc4ac090de3008 (patch) | |
| tree | 516bbc52e190a6eb463e71e508d9a682125b4980 /internal/api/api.go | |
| parent | 921b7f6449c32c5788e43c128ab9f46683dba8e8 (diff) | |
API auth: Return if err is not invalid tokens
E.g. if refreshing fails here with a 500 or something else
Diffstat (limited to 'internal/api/api.go')
| -rw-r--r-- | internal/api/api.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 } |
