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: Add refresh token to signOut request body #731

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MisterNox
Copy link

πŸ”— Linked issue

#730

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Adds the refresh token to the signOut request body with the key set according to the defined refreshRequestTokenPointer.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@zoey-kaiser zoey-kaiser linked an issue May 9, 2024 that may be closed by this pull request
5 tasks
@zoey-kaiser zoey-kaiser added enhancement An improvement that needs to be added provider-refresh An issue with the refresh provider labels May 9, 2024
Copy link
Member

@zoey-kaiser zoey-kaiser left a comment

Choose a reason for hiding this comment

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

Hi @MisterNox πŸ‘‹

Thank you so much for your contribution! As we are currently aiming for a larger 0.8 release, we will add your enchantment to that release.

@phoenix-ru, I think this PR is good to go, I would recommend that after your reviews we can merge this in the next batch and relase it in the next 0.8.0-alpha.2 release!

@@ -168,7 +172,7 @@ const signOut: SignOutFunc = async (signOutOptions) => {
| 'options'
| 'trace';
}
res = await _fetch(nuxt, path, { method, headers })
res = await _fetch(nuxt, path, { method, headers, body: method.toLowerCase() === 'post' ? body : undefined })
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be better to build body only when the check is truthy:

const body = method.toLowerCase() === 'get'
  ? undefined
  : objectFromJsonPointer(config.refreshToken.refreshRequestTokenPointer, refreshToken.value)

@zoey-kaiser
Copy link
Member

Hi @MisterNox πŸ‘‹

Have you had a chance to look at the review yet? Otherwise are there any other open questions I can help you with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement that needs to be added provider-refresh An issue with the refresh provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refresh token should be added to the signOut body
3 participants