adobe / adobe/pdf-embed-api-samples

How to handle 401 unauthorized error on jwt route

Open
#66 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
235
Forks
140
PR merge metrics
No merged PRs in 30d

Description

If for some reason the credentials have expired or the domain making the request has not been whitelisted, we get a 401 Unauthorized error on the jwt authentication request. But I couldn't find any example on how to handle this kind of error properly, like in a global document event like "adobe_dc_view_sdk.error" for example or as an error callback in the configuration object.

The real problem is that when this Unauthorized error occurs, the embedded Adobe view conflicts with the text inputs, so that when I click on an input to write text, the input immediately loses focus, making it impossible to write anything!

![Image](https://github.com/user-attachments/assets/835f9f33-b612-4f90-adb0-c5a50fc7da39)

![Image](https://github.com/user-attachments/assets/da357548-f447-483b-b6c3-4f64cf8cde5f)

![Image](https://github.com/user-attachments/assets/db7c1ac2-980d-4778-8e8e-b9523be70fde)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.