nuxt-auth icon indicating copy to clipboard operation
nuxt-auth copied to clipboard

Custom refresh response token pointer

Open Rizzato95 opened this issue 1 year ago β€’ 4 comments

Describe the feature

Hi,

I'm using the module in local mode pointing to an external api (to which I don't have access and cannot edit). During sign in the token comes in bearerToken property:

{
  ...
  "bearerToken": "my-token",
}

But during refresh the token comes in accessToken property:

{
  ...
  "accessToken": "my-token",
}

In the configuration I set signInResponseTokenPointer to /bearerToken who works like a charm during SignIn but returns an error during refresh:

image

This happens because the module uses signInResponseTokenPointer to retrieve the token also during the refresh call.

What I need is a configuration property like refreshResponseTokenPointer to allow the token to be handled correctly when provided in different properties between calls.

Thanks

Provider

  • [ ] AuthJS
  • [X] Local
  • [ ] Refresh
  • [ ] New Provider

Rizzato95 avatar Sep 02 '24 15:09 Rizzato95

Hi @Rizzato95 , thanks for your request. As we're a bit busy at the moment with higher priority issues, would you give it a try yourself? We would be able to quickly review your PR

phoenix-ru avatar Sep 12 '24 09:09 phoenix-ru

Same problem here. I'm coming from version 0.7.2, where there was that option. I've also opened an issue #635 and it was fixed #727.

N1K1TAS95 avatar Sep 16 '24 18:09 N1K1TAS95

Same problem here. I'm coming from version 0.7.2, where there was that option. I've also opened an issue #635 and it was fixed #727.

I think we're not talking about the same problem. You asked for an option in the refresh request (which is now present as you correctly say), I need it in the refresh response.

I created a PR (#910) for this new option.

Rizzato95 avatar Sep 16 '24 22:09 Rizzato95

@Rizzato95 ops πŸ˜…. You’re right, my bad.

N1K1TAS95 avatar Sep 17 '24 04:09 N1K1TAS95

Closing as done in #910

phoenix-ru avatar Dec 19 '24 18:12 phoenix-ru