INNER CODE UNIT · TypeScript

result

synthetic-sciences/openscience · backend/cli/src/auth/index.ts:172

    const result = await CredentialLifecycle.update(async () => {
      const current = Oauth.safeParse((await JsonStore.read(filepath))[key])
      if (
        !current.success ||
        current.data.refresh !== previous.refresh ||
        current.data.access !== previous.access ||
        current.data.expires !== previous.expires ||
        current.data.accountId !== previous.accountId ||
        current.data.enterpriseUrl !== previous.enterpriseUrl
      )
        return
      return {
        reason: `provider-auth.renew:${key}`,
        action: () => JsonStore.update(filepath, (data) => ({ ...data, [key]: next })),
      }
    })
    return result.applied
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…