Skip to content
Snippets Groups Projects
Commit ee449cfb authored by Gospodin Bodurov's avatar Gospodin Bodurov
Browse files

Add old GetPassport api

parent 080ba1b9
No related branches found
No related tags found
1 merge request!52Collabora fix
......@@ -1227,6 +1227,21 @@ const connection = Penpal.connectToParent({
return response.data;
},
getPassports: async fileId => {
const authenticationPublicKey = localStorage.getItem("authenticatedIdentity");
if (
!authenticationPublicKey ||
!window.loadedIdentities[authenticationPublicKey] ||
!extendPinCodeTtl(authenticationPublicKey)
) {
return encodeResponse("400", "", "Identity not authenticated");
}
const response = await wopiAPI.getPassports(fileId);
return response.data;
},
wopiCreateDocument: async (passportUUID, path, contentType, title) => {
const authenticationPublicKey = localStorage.getItem("authenticatedIdentity");
if (
......
......@@ -20,6 +20,23 @@ WopiAPI.prototype.getPassportsNewProtocol = function (resourceID, contentType) {
return axios(requestConfig);
};
WopiAPI.prototype.getPassports = function (fileID) {
const { publicKey, uuid, token, deviceHash } = window.viamApi.getConfig().headers;
const requestConfig = {
url: `${window.WOPI_URL}getPassports`,
method: 'POST',
headers: {
publicKey,
uuid,
token,
deviceHash,
fileID: encodeURI(fileID)
}
};
return axios(requestConfig);
};
WopiAPI.prototype.putDocument = function (resourceID, accessToken, file) {
const { publicKey, uuid, token, deviceHash } = window.viamApi.getConfig().headers;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment