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

feat: use token events to subscribe to the token changes #2830

Merged
merged 5 commits into from Nov 6, 2023

Conversation

pavanjoshi914
Copy link
Contributor

Describe the changes you have made in this PR

listen for token changes via alby-js-sdk events

Type of change

(Remove other not matching type)

  • feat: New feature (non-breaking change which adds functionality)

How has this been tested?

trying oauth in extension

Checklist

  • Self-review of changed code
  • Manual testing
  • Added automated tests where applicable
  • Update Docs & Guides
  • For UI-related changes
  • Darkmode
  • Responsive layout

@socket-security
Copy link

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@getalby/sdk 2.2.3...2.5.0 None +0/-0 903 kB reneaaron

@@ -254,11 +254,22 @@ export default class Alby implements Connector {
token: this.config.oAuthToken, // initialize with existing token
});

//// Currently the JS SDK guarantees request of a new refresh token is done synchronously.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is in the wrong place

Can you put it in the authClient.on("tokenRefreshFailed") function?

Copy link
Contributor

@rolznz rolznz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@rolznz rolznz merged commit 8463370 into master Nov 6, 2023
5 of 6 checks passed
@rolznz rolznz deleted the feat/use-token-events branch November 6, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants