No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    qpdfviewer - src: Server-URL with Token for Authorization is truncated

    [v1] App Extensions
    3
    5
    344
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kwi last edited by kwi

      Hi,

      I want to use the qpdfviewer for viewing PDF files that I load from the server. The URL to the server contains a session token.

      The URL (attachmentURL) looks something like this: /api/…/4/file?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsic2VtaXNBcHAiXSwidXNlcl9uYW1lIjoia2Vyc3RpbiIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE1OTIzOTgwNzYsImF1dGhvcml0aWVzIjpbIkF1dGhvcml6ZWRCeURhdGFiYXNlIl0sImp0aSI6ImIyNTY4YzE5LWM2OGMtNDMxYy04MjVhLTY4ODliMTk3NjVjZiIsImNsaWVudF9pZCI6InNlbWlzQXBwIn0.1ejO0_7kQFZMRFhEbDODBnrJWZt3HM_7Wv6mO7HQp3A

      <q-pdfviewer
      v-model=“show”
      :src=“attachmentURL”
      type=“pdfjs”
      content-class=“absolute”
      />

      Unfortunately the request looks like this: http://localhost:8081/api/.../4/file?access_token

      Because the token is missing, I receive a Response_Status 401 from the server.

      What do I have to do so that I can give the token via the Request in src:?

      1 Reply Last reply Reply Quote 0
      • K
        kwi last edited by

        After a few more tests I assume that the URL is truncated starting with an included “=”

        G 1 Reply Last reply Reply Quote 0
        • Hawkeye64
          Hawkeye64 last edited by

          @kwi This is “pdfjs” you will need to ask them. Unfortunately, I really don’t know much about this part (pdfjs). The app-ext just provides it, mostly for apps that don’t have the HTML 5 PDF reader built in (like Electron and Capicitor).

          1 Reply Last reply Reply Quote 0
          • G
            gruppler @kwi last edited by

            @kwi Were you ever able to work around your problem? I’m running into the same thing.

            G 1 Reply Last reply Reply Quote 0
            • G
              gruppler @gruppler last edited by

              @gruppler Figured it out! Just need to run the src through encodeURIComponent first.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post