# @theorchard/songwhip-utils-auth

## 2.1.1

### Patch Changes

- Fixes a bug where the userUuid field was parsed from the wrong claim in the Orchard token, which could cause valid tokens to be rejected.

## 2.1.0

### Minor Changes

- Parses and exposes impersonation details in the Orchard id token.

## 2.0.1

### Patch Changes

- Bumped jose to ^6.2.2

## 2.0.0

### Major Changes

- Moved token invalidation logic from this package to songwhip-utils-express. This to keep this package compatible with edge runtimes. And we will currently only use the token invalidation logic in our AWS hosted express services.

## 1.3.2

### Patch Changes

- Changes the "@theorchard/songwhip-utils-redis" dependency from peer to optional. Not all consumers of this package will use the token invalidation logic.

## 1.3.1

### Patch Changes

- Change the songwhip JWT schema to allow undefined userUuid fields.

## 1.3.0

### Minor Changes

- Adds token invalidation logic for storing and checking for invalidated JWTs.
- Exports two new functions: "isTokenInvalidated" and "invalidateToken".

## 1.2.1

### Patch Changes

- Fixes an issue where an 500 error was thrown if the JWT had an invalid header. It now properly returns a 401 with a clear error message.
- Changes 400 errors for invalid tokens to 401 to better reflect the nature of the error.

## 1.2.0

### Minor Changes

- Adds support for Auth0 / Orchard M2M token verification.
- Makes the "userUuid" field required in the Songwhip token schema and shared types, as it is the authoritative user ID across services. Strictly a major breaking change, but this is the first actual production ready release of this package.
- Improves error handling and messages for token verification failures.
- Fixed compatibility with edge runtimes
- Fixes bug in the JWKS cache logic, where different auth domains were not properly supported.

### Patch Changes

- Updated dependencies
  - @theorchard/songwhip-utils@1.2.0

## 1.0.17

### Patch Changes

- Initial publish
- Updated dependencies
  - @theorchard/songwhip-utils@1.0.15
