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

CF SDK: OAuth refresh token #982

Merged
merged 2 commits into from
Mar 12, 2024
Merged

CF SDK: OAuth refresh token #982

merged 2 commits into from
Mar 12, 2024

Conversation

iAmmar7
Copy link
Collaborator

@iAmmar7 iAmmar7 commented Mar 11, 2024

Description

Reauthenticate the user when the token expires.

Type of change

  • Internal refactoring
  • Bug fix (bugfix - non-breaking)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Code snippets

// Implicitly refresh token
const client = await SignalWire({
      host: "...",
      token: ".......",
      rootElement: ".....",
      onRefreshToken: () => {
        const newToken = 'eyJh.....'
        return newToken
      },

// Explicitly refresh token
await client.updateToken(newToken)

Copy link

changeset-bot bot commented Mar 11, 2024

🦋 Changeset detected

Latest commit: 390334c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@signalwire/core Patch
@signalwire/js Patch
@signalwire/realtime-api Patch
@signalwire/web-api Patch
@signalwire/webrtc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@iAmmar7
Copy link
Collaborator Author

iAmmar7 commented Mar 11, 2024

Note: The implementation involves calling the signalwire.reauthenticate method which is currently failing for SAT. Due to this, with the current SDK behavior, the client is going to be disconnected when signalwire.reauthenticate rpc throws an error.

@iAmmar7 iAmmar7 merged commit ded3dc7 into dev Mar 12, 2024
5 of 10 checks passed
@iAmmar7 iAmmar7 deleted the aa/reauth-cf branch March 12, 2024 10:14
iAmmar7 added a commit that referenced this pull request Mar 19, 2024
* OAuth refresh token

* include changeset
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.

2 participants