| 70 | } |
| 71 | |
| 72 | func storeErrorsToRevocationError(err1, err2 error) error { |
| 73 | // both errors are fosite.ErrNotFound and fosite.ErrInactiveToken or nil <=> the token is revoked |
| 74 | if (errors.Is(err1, fosite.ErrNotFound) || errors.Is(err1, fosite.ErrInactiveToken) || err1 == nil) && |
| 75 | (errors.Is(err2, fosite.ErrNotFound) || errors.Is(err2, fosite.ErrInactiveToken) || err2 == nil) { |
| 76 | return nil |
| 77 | } |
| 78 | |
| 79 | // there was an unexpected error => the token may still exist and the client should retry later |
| 80 | return errorsx.WithStack(fosite.ErrTemporarilyUnavailable) |
| 81 | } |