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

[TS] [Azure] [Clerk] Allow getToken(options?) argument #11918

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

Conversation

Philzen
Copy link
Contributor

@Philzen Philzen commented Jan 22, 2025

Passing any options to getToken with Azure and Clerk would work, but give a TypeScript error, for example this:

const { getToken } = useAuth()
getToken({
  forceRefresh: true,
  scopes: ['openid', 'profile'],
})

would make TypeScript complain "Expected 0 arguments, but got 1". This PR fixes that, enabling nice intellisense auto-completion instead:

grafik

Resolves #11917

@Philzen Philzen changed the title Feature/11917 allow typing for get token auth method [Azure] [Clerk] Allow arguments in getToken() Jan 22, 2025
@Philzen Philzen changed the title [Azure] [Clerk] Allow arguments in getToken() [Azure] [Clerk] Allow getToken(options?) argument Jan 22, 2025
@Philzen Philzen marked this pull request as ready for review January 22, 2025 22:57
@Philzen Philzen changed the title [Azure] [Clerk] Allow getToken(options?) argument [TS] [Azure] [Clerk] Allow getToken(options?) argument Jan 22, 2025
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.

[RFC]: AuthContextInterface should support passing options to getToken
1 participant