Ganesan-Chandran / vscode-fetch-client

Fetch Client is Visual Studio Code extension which is used to test the Rest API.
https://marketplace.visualstudio.com/items?itemName=GanesanChandran.fetch-client
MIT License
15 stars 9 forks source link

Bearer Token as a variable does not work #4

Closed sviatcraft closed 2 years ago

sviatcraft commented 2 years ago

Describe the bug Bearer Token as a variable does not work

To Reproduce Steps to reproduce the behavior:

  1. Go to the "Variable" tab
  2. Create variable "token"
  3. Add token key to that variable
  4. Go to "Collection" and create a request
  5. In "Request"->"Authorization"->"Bearer Token"->"Token"(field) add {{token}}
  6. Variable is highlighted in green (is legit)

Expected behavior The request is successful, the token is legit

Actual behavior The request is failing, the token is not legit

Note Token is 100 characters long. If I paste token-key directly, without variable, it works.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Ganesan-Chandran commented 2 years ago

Hi @sviatcraft ,

It is working for me.

1) I have created below variable (test).

image

2) I have created one collection, added request to it and attached the variable to collection.

image

3) I have added {{token}} in auth bearer token section (my token length is 65).

image

4) I can send the request without fail.

image

I couldn't reproduce issue.

Am i missed any steps?

sviatcraft commented 2 years ago

@Ganesan-Chandran I found out why I am having this problem. My token in reality is 942 characters long, and I can enter only 100 characters in variables. Is it possible to increase the max length for variables?

Ganesan-Chandran commented 2 years ago

Sure @sviatcraft . We will fix this issue in coming release.

Ganesan-Chandran commented 2 years ago

Removed Max Length restriction. Released in v1.2.0. Please update the Fetch Client and let me know your feedback. Thanks.