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

Allow manipulation of provider response #1067

Closed
jackHedaya opened this issue Jan 10, 2021 · 2 comments
Closed

Allow manipulation of provider response #1067

jackHedaya opened this issue Jan 10, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jackHedaya
Copy link

Summary of proposed feature
I believe it would be useful for there to be a callback for right after the Provider API is hit.

Purpose of proposed feature
This is helpful because some OAuth Providers will send back tokens in different formats such as refresh_token instead of refreshToken.

Detail about proposed feature
There would be a res callback.

Potential problems
None that I could tell.

Describe any alternatives you've considered
N/A

Please indicate if you are willing and able to help implement the proposed feature.
Yes

@jackHedaya jackHedaya added the enhancement New feature or request label Jan 10, 2021
@balazsorban44
Copy link
Member

balazsorban44 commented Jan 10, 2021

Hi there, do you have a special case where this has been a problem?

As far as I can tell, the OAuth spec says it has to be in the form at refresh_token, and as you see here:

const refreshToken = results.refresh_token

we do expect it to be refresh_token.

If there is an OAuth provider that for some reason returns a refreshToken, we could add an extra if statement for that particular provider, but to keep the user-facing API simple (#1022 ), I wish not to expose a new option if your case is an isolated one. You could rather add a new provider to the list of supported providers, and we can handle a special case internally, using the provider.id.

Adding

const refreshToken = results.refresh_token ?? results.refreshToken

is a no-brainer also.

@jackHedaya
Copy link
Author

jackHedaya commented Jan 10, 2021

That's my bad then, I'm not sure why my custom provider isn't working. I opened a discussion issue and I'll give that a try. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants