elements
elements copied to clipboard
Oauth Authorization token defaults to undefined
Describe the bug
Request sample sometimes contain an undefined token.
To Reproduce
- Open a spec with Oauth security and open a page that requires it. For example: https://elements-demo.stoplight.io/?spec=https://raw.githubusercontent.com/digitalocean/openapi/main/specification/DigitalOcean-public.v2.yaml#/operations/install_kubernetes.
- Look at "Request Sample" in the right bar.
- The token value will be
undefinedfor the Authorization header, i.e."Authorization": "Bearer undefined".
Expected behavior
Expected at least a value. A clear indication that an authorization token is needed would be nice, for example $TOKEN. Or a more complex fix perhaps even a language specific variable.
It should be empty Bearer . Shouldn't show up as undefined.
I'd love to be able to supply the placeholder as part of the props in the web component (with a sensible default, like the empty space per @mnaumanali94). If it's too small a feature for its own prop, maybe it can be part of a more general options prop or similar.