Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency @urql/exchange-auth to v2 #284

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 28, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@urql/exchange-auth (source) 1.0.0 -> 2.2.0 age adoption passing confidence

Release Notes

urql-graphql/urql (@​urql/exchange-auth)

v2.2.0

Compare Source

Minor Changes
  • Mark @urql/core as a peer dependency as well as a regular dependency
    Submitted by @​kitten (See #​3579)

v2.1.6

Compare Source

Patch Changes
  • authExchange() will now block and pass on errors if the initialization function passed to it fails, and will retry indefinitely. It’ll also output a warning for these cases, as the initialization function (i.e. authExchange(async (utils) => { /*...*/ })) is not expected to reject/throw
    Submitted by @​kitten (See #​3343)

v2.1.5

Compare Source

Patch Changes
  • Handle refreshAuth rejections and pass the resulting error on to OperationResults on the authentication queue
    Submitted by @​kitten (See #​3307)

v2.1.4

Compare Source

Patch Changes
  • ⚠️ Fix regression that caused teardowns to be ignored by an authExchange’s retry queue
    Submitted by @​kitten (See #​3235)

v2.1.3

Compare Source

Patch Changes
  • Update build process to generate correct source maps
    Submitted by @​kitten (See #​3201)

v2.1.2

Compare Source

Patch Changes

v2.1.1

Compare Source

Patch Changes
  • ⚠️ Fix operations created by utilities.mutate() erroneously being retried and sent again like a regular operation
    Submitted by @​JoviDeCroock (See #​3164)

v2.1.0

Compare Source

Minor Changes
  • Update exchanges to drop redundant share calls, since @urql/core’s composeExchanges utility now automatically does so for us
    Submitted by @​kitten (See #​3082)
Patch Changes

v2.0.0

Compare Source

Major Changes
  • Implement new authExchange API, which removes the need for an authState (i.e. an internal authentication state) and removes getAuth, replacing it with a separate refreshAuth flow.
    The new API requires you to now pass an initializer function. This function receives a utils
    object with utils.mutate and utils.appendHeaders utility methods.
    It must return the configuration object, wrapped in a promise, and this configuration is similar to
    what we had before, if you're migrating to this. Its refreshAuth method is now only called after
    authentication errors occur and not on initialization. Instead, it's now recommended that you write
    your initialization logic in-line.
    authExchange(async utils => {
      let token = localStorage.getItem('token');
      let refreshToken = localStorage.getItem('refreshToken');
      return {
        addAuthToOperation(operation) {
          return utils.appendHeaders(operation, {
            Authorization: `Bearer ${token}`,
          });
        },
        didAuthError(error) {
          return error.graphQLErrors.some(
            e => e.extensions?.code === 'FORBIDDEN'
          );
        },
        async refreshAuth() {
          const result = await utils.mutate(REFRESH, { token });
          if (result.data?.refreshLogin) {
            token = result.data.refreshLogin.token;
            refreshToken = result.data.refreshLogin.refreshToken;
            localStorage.setItem('token', token);
            localStorage.setItem('refreshToken', refreshToken);
          }
        },
      };
    });
    Submitted by @​kitten (See #​3012)
Patch Changes
  • ⚠️ Fix willAuthError not being called for operations that are waiting on the authentication state to update. This can actually lead to a common issue where operations that came in during the authentication initialization (on startup) will never have willAuthError called on them. This can cause an easy mistake where the initial authentication state is never checked to be valid
    Submitted by @​kitten (See #​3017)
  • Updated dependencies (See #​3007, #​2962, #​3007, #​3015, and #​3022)

Configuration

📅 Schedule: Branch creation - "before 2am" in timezone Asia/Tokyo, Automerge - "before 2am" in timezone Asia/Tokyo.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@vercel
Copy link

vercel bot commented May 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
shikosai32 ❌ Failed (Inspect) May 10, 2024 2:44pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants