# @theorchard/suite-auth

## 4.19.0

### Minor Changes

-   Update auth0-spa-js

## 4.18.0

### Minor Changes

-   Add session expiration logging

## 4.17.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.4.3

## 4.17.0

### Minor Changes

-   Add AuthError locale

## 4.16.0

### Minor Changes

-   Add `retrySession` function

## 4.15.0

### Minor Changes

-   Add parsing of expired password error

## 4.14.0

### Minor Changes

-   Add account_switch URL param handling for WS account switching

## 4.13.0

### Minor Changes

-   Include inlineSources to tsconfig to reduce pnpm test noise

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-config@1.10.0

## 4.12.3

### Patch Changes

-   Add lodash-es to lodash jest module mapping for ESM compatibility

## 4.12.2

### Patch Changes

-   Classify deactivated user impersonation errors as impersonationFailed

## 4.12.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-identity@3.5.0

## 4.12.0

### Minor Changes

-   Sentry to properly log invalid/expired errors

## 4.11.0

### Minor Changes

-   Add optional session expiration handler

## 4.10.0

### Minor Changes

-   new Identity.loginCountryCode prop

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-identity@3.4.0

## 4.9.0

### Minor Changes

-   Add logout parameter to control logout propagating to other apps.

## 4.8.0

### Minor Changes

-   dateFormat support

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-identity@3.3.0

## 4.7.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.6.0

## 4.7.0

### Minor Changes

-   Add secondaryProfileTypes field that allows app to accept multiple profiles

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-config@1.9.0

## 4.6.12

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.4.1

## 4.6.11

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-config@1.8.0

## 4.6.10

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.5.0

## 4.6.9

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-config@1.7.0

## 4.6.8

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.4.0

## 4.6.7

### Patch Changes

-   Updated dependencies
    -   @theorchard/field-validator@1.5.4
    -   @theorchard/suite-config@1.6.5

## 4.6.6

### Patch Changes

-   Updated dependencies
    -   @theorchard/field-validator@1.5.3
    -   @theorchard/suite-config@1.6.4

## 4.6.5

### Patch Changes

-   Updated dependencies
    -   @theorchard/field-validator@1.5.2
    -   @theorchard/suite-config@1.6.3

## 4.6.4

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.3.4

## 4.6.3

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.4.1
    -   @theorchard/field-validator@1.5.1
    -   @theorchard/suite-config@1.6.2

## 4.6.2

### Patch Changes

-   Added exports field to package.json
-   Updated dependencies
    -   @theorchard/suite-config@1.6.1
    -   @theorchard/suite-identity@3.2.1
    -   @theorchard/suite-utils@1.3.3

## 4.6.1

### Patch Changes

-   Fix previously broken build

## 4.6.0

### Minor Changes

-   Show ows-users 500 errors as "Failed to login"
-   Update auth0 client sdk to the latest version.

## 4.5.1

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.4.0

## 4.5.0

### Minor Changes

-   Refresh token on boot when an `impersonating` param is passed

## 4.4.0

### Minor Changes

-   Add `intercomUserHash` to identity if available in id token

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-identity@3.2.0

## 4.3.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.3.2

## 4.3.1

### Patch Changes

-   Handle auth0 impersonation errors

## 4.3.0

### Minor Changes

-   Add refreshAuthenticatedUser method to client

## 4.2.11

### Patch Changes

-   Impersonation: Fix user picture/email

## 4.2.10

### Patch Changes

-   Updated dependencies
    -   @theorchard/constants@1.3.1

## 4.2.9

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-config@1.6.0

## 4.2.8

### Patch Changes

-   Fix auth refresh logic by adding a small delay before clearing the cookie.

## 4.2.7

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.3.1

## 4.2.6

### Patch Changes

-   Clear persisted auth0 tokens on missing profile errors.

## 4.2.5

### Patch Changes

-   Removed parsing password grant tokens wrongly set by cypress.
-   Updated dependencies
    -   @auth0/auth0-spa-js@2.0.7

## 4.2.4

### Patch Changes

-   Fix bug where the "enableRoleHeader", "appName" and "appVersion" was not respected in the authClient.getHeaders() call.

## 4.2.3

### Patch Changes

-   Fix bug in handling profiles for test users using the password grant type.

## 4.2.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-identity@3.1.0

## 4.2.1

### Patch Changes

-   Fixes "no profile" error not mapped to the "noAccess" code.

## 4.2.0

### Minor Changes

-   Added error code parsing / normalization from suite-frontend.

## 4.1.3

### Patch Changes

-   Fix missing applications for users using password grant type ( test users ).

## 4.1.2

### Patch Changes

-   Include missing data for the identity `userTypes` field.

## 4.1.1

### Patch Changes

-   Fix bug where the identity applications were not included from the id token.

## 4.1.0

### Minor Changes

-   Exposes a new `refresh` method on the `AuthClient` interface that should refresh the session.
-   The `SuiteAuth0Client` class will request a new id and access token when invoking the new `refresh` method. It will also signal other suite apps in other tabs to do the same.

## 4.0.1

### Patch Changes

-   Add support for e2e test users using the password grant type.

## 4.0.0

### Major Changes

-   Uses the id token to hydrate the identity object instead of decoding the access token.
-   The `AuthUser` interface is replaced with `Identity` ( defined in suite-identity ).
-   Removed peer dependency on react-router-dom.

### Breaking Changes

-   Information stored in the access JWT is no longer used.
-   The `AuthUser` interface is removed.
-   The `useAuthUser` React hook is removed.
-   The `AuthContext` is renamed to `AuthClientContext` and will only provide the `AuthClient` instance.
-   The `AuthClient` functions no longer accepts options.

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-identity@3.0.0
    -   @theorchard/suite-config@1.5.0

## 3.6.0

### Minor Changes

-   Fixed an issue where the original url was not restored during auth redirect.
-   SuiteAuth0Client now accepts a history reference in its constructor options.

## 3.5.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-config@1.4.1

## 3.5.1

### Patch Changes

-   Invalidate token and cross-tab impersonated sessions when logging out.

## 3.5.0

### Minor Changes

-   If impersonated, then logging out will end the impersonation session, not the auth0 session.

## 3.4.1

### Patch Changes

-   Remove app state on impersonation.

## 3.4.0

### Minor Changes

-   Handles a new "impersonate" url param to initiate an impersonation session.

## 3.3.1

### Patch Changes

-   Throws proper AuthClientError on auth0 errors.

## 3.3.0

### Minor Changes

-   AuthError.user type is now a partial AuthUser.

## 3.2.0

### Minor Changes

-   Errors during authentication will now include the decoded id token (user claims).
-   The AuthUser includes a new "applications" property decoded from the id token.

## 3.1.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.3.0

## 3.1.1

### Patch Changes

-   Force re-authentication if the cached refresh token is invalid.

## 3.1.0

### Minor Changes

-   Encapsulates auth0 auth flow in a new extensible SuiteAuth0Client class.

## 3.0.2

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-config@1.4.0

## 3.0.1

### Patch Changes

-   Parse authId param in invite links

## 3.0.0

### Major Changes

-   Moved the "useAuthFlow" hook to suite-frontend so we can override the auth client instance.
-   Exports "createAuthHeaders" moved from suite-apollo.
-   The `AuthClient` interface has two new functions:
    -   authenticate: performs the auth logic and returns the auth user.
    -   getHeaders: creates the headers needed for requests to our backend services.
        This change means we can swap out the `AuthClient` in suite-frontend to perform custom authentication and header generation.
-   Upgraded `@auth0/auth0-spa-js` to version 2.

### Breaking Changes

-   Removed the exported "useAuthFlow" function.
-   Removed the exported "useLogoutMonitor" function.

## 2.4.0

### Minor Changes

-   Accepts "uuid" query param in invitation links.

## 2.3.0

### Minor Changes

-   Include email in appState for invitation links.
-   Include appState values in errors.

## 2.2.8

### Patch Changes

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

## 2.2.7

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.1.2

## 2.2.6

### Patch Changes

-   Updated dependencies
    -   @theorchard/field-validator@1.5.0

## 2.2.5

### Patch Changes

-   Updated dependencies
    -   @theorchard/field-validator@1.4.0

## 2.2.4

### Patch Changes

-   Updated dependencies
    -   @theorchard/field-validator@1.3.0

## 2.2.3

### Patch Changes

-   Set explicit path for logout cookie

## 2.2.2

### Patch Changes

-   Fix logout cookie removal

## 2.2.1

### Patch Changes

-   Fix race conditions in logout monitor

## 2.2.0

### Minor Changes

-   Log out from all suite apps when one application is logged out

## 2.1.4

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.1.1

## 2.1.3

### Patch Changes

-   Updated dependencies
    -   @theorchard/suite-utils@1.1.0

## 2.1.2

### Patch Changes

-   Updated dependencies []
    -   @theorchard/field-validator@1.2.0

## 2.1.1

### Patch Changes

-   Updated dependencies []
    -   @theorchard/field-validator@1.1.0

## 2.1.0

### Minor Changes

-   Fixes token invalidation on logout.
-   Replaces hardcoded endpoint with a new "authTokenInvalidationUrl" option.

## 2.0.1

### Patch Changes

-   Passthrough error description from auth0 as error.message.

## 2.0.0

### Major Changes

-   Fixes a bug where the original url was lost when redirected back from auth0.

#### Breaking Changes

-   suite-auth now depends on `react-router-dom` and expects a router instance in the react context.

## 1.0.8

### Patch Changes

-   Remove unused exports
-   Export clearHistoryState util

## 1.0.7

### Patch Changes

-   Updated dependencies []
    -   @theorchard/suite-utils@1.0.2

## 1.0.6

### Patch Changes

-   Make roles optional

## 1.0.5

### Patch Changes

-   Add profile roles attribute

## 1.0.4

### Patch Changes

-   Add profile uuid as optional attribute

## 1.0.3

### Patch Changes

-   Added tests
-   Improved error handling

## 1.0.2

### Patch Changes

-   Add `defaultProfileType` to useAuthFlow hook.

## 1.0.1

### Patch Changes

-   Exports `clearAllCookies` util

## 1.0.1

### Patch Changes

-   Remove unused provider

## 0.9.16

### Patch Changes

-   Update dependencies

## 0.9.15

### Patch Changes

-   Added grass endpoint to send active access token to ows-grass on logout

## 0.9.14

### Patch Changes

-   Remove dependency on "querystring"

## 0.9.13

### Patch Changes

-   add invitation support + jwt "identity brand"

## 0.9.12

### Patch Changes

-   Remove dependency on suite-components

## 0.9.11

### Patch Changes

-   Updated dependencies []
    -   @theorchard/suite-components@1.0.9

## 0.9.10

### Patch Changes

-   Memoize authClient

## 0.9.9

### Patch Changes

-   The `AuthError` interface now extends `Error`.
-   Changed `data` prop returned from `useAuthFlow`. The `data` prop is now always defined.

## 0.9.8

### Patch Changes

-   @theorchard/suite-components@1.0.8

## 0.9.7

### Patch Changes

-   bugfixing providers to properly work all together

## 0.9.6

### Patch Changes

-   suite-auth identity.profiles[] backward compatibility
-   Updated dependencies []

## 0.9.5

### Patch Changes

-   @theorchard/suite-components@1.0.6

## 0.9.4

### Patch Changes

-   Add profileId / profileType to AuthUser

## 0.9.3

### Patch Changes

-   fixes redirectUri + useAuthFlow infinite render

## 0.9.2

### Patch Changes

-   fixes mockClient export + fix README

## 0.9.1

### Patch Changes

-   Initial package with AuthProvider, useAuthClient useAuthUser
