elements icon indicating copy to clipboard operation
elements copied to clipboard

Oauth Authorization token defaults to undefined

Open Thomasdezeeuw opened this issue 3 years ago • 2 comments

Describe the bug

Request sample sometimes contain an undefined token.

To Reproduce

  1. 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.
  2. Look at "Request Sample" in the right bar.
  3. The token value will be undefined for 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.

Thomasdezeeuw avatar Feb 17 '22 14:02 Thomasdezeeuw

It should be empty Bearer . Shouldn't show up as undefined.

mnaumanali94 avatar Feb 17 '22 17:02 mnaumanali94

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.

colmanhumphrey avatar Mar 06 '22 01:03 colmanhumphrey