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: missing fingerprint when refreshing token silently #111

Merged

Conversation

aversini
Copy link
Collaborator

@aversini aversini commented Jul 16, 2024

PR Type

Bug fix


Description

  • Added the missing fingerprint parameter when refreshing the token silently to ensure proper authentication.

Changes walkthrough 📝

Relevant files
Bug fix
utilities.ts
Add missing fingerprint parameter in token refresh request

packages/auth-provider/src/common/utilities.ts

  • Added fingerprint parameter to the token refresh request.
+1/-0     

💡 PR-Agent usage:
Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

Copy link

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No key issues to review

Copy link

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Score
Possible issue
Add error handling for the asynchronous call to getCustomFingerprint()

Consider handling the scenario where getCustomFingerprint() might fail or return
null. This can be done by providing a fallback value or by wrapping the call in a
try-catch block to handle potential errors gracefully.

packages/auth-provider/src/common/utilities.ts [212]

-fingerprint: await getCustomFingerprint(),
+fingerprint: await getCustomFingerprint().catch(e => {
+  console.error('Failed to get fingerprint:', e);
+  return null; // or a sensible default
+}),
 
  • Apply this suggestion
Suggestion importance[1-10]: 9

Why: The suggestion correctly identifies a potential issue where getCustomFingerprint() might fail or return null, and provides a robust solution by adding error handling. This improves the reliability and stability of the code.

9

Copy link

Bundle Size

Status File Size (Gzip) Limits
index.js 20.56 KB (+4 B +0.02%) 21 kb

Overall bundle size: 20.56 KB (+4 B +0.02%)
Overall status: ✅

@aversini aversini merged commit cf78b8b into main Jul 16, 2024
4 checks passed
@aversini aversini deleted the fix-missing-fingerprint-when-refreshing-token-silently branch July 16, 2024 21:24
@aversini aversini mentioned this pull request Jul 16, 2024
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.

1 participant