Commit 02dc3f49 authored by konovalovsergey's avatar konovalovsergey

jwt token on open

parent 5b80b6a3
......@@ -407,7 +407,11 @@
rData["userconnectionid"] = this.CoAuthoringApi.getUserConnectionId();
}
}
this.CoAuthoringApi.auth(this.getViewMode(), rData);
if (isVersionHistory) {
this.CoAuthoringApi.versionHistory(rData);
} else {
this.CoAuthoringApi.auth(this.getViewMode(), rData);
}
if (!isRepeat) {
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
......
......@@ -2488,6 +2488,9 @@
if (typeof obj.VKey != 'undefined') {
this.VKey = obj.VKey;
}
if (typeof obj.Token != 'undefined') {
this.Token = obj.Token;
}
if (typeof obj.UserId != 'undefined') {
this.UserId = obj.UserId;
}
......@@ -2502,6 +2505,15 @@
if (typeof obj.CallbackUrl != 'undefined') {
this.CallbackUrl = obj.CallbackUrl;
}
if (typeof obj.Mode != 'undefined') {
this.Mode = obj.Mode;
}
if (typeof obj.Permissions != 'undefined') {
this.Permissions = obj.Permissions;
}
if (typeof obj.Lang != 'undefined') {
this.Lang = obj.Lang;
}
if (obj.OfflineApp === true) {
this.OfflineApp = true;
}
......@@ -2514,10 +2526,14 @@
this.Title = null;
this.Format = null;
this.VKey = null;
this.Token = null;
this.UserInfo = null;
this.Options = null;
this.CallbackUrl = null;
this.TemplateReplacement = null;
this.Mode = null;
this.Permissions = null;
this.Lang = null;
}
}
......@@ -2551,6 +2567,12 @@
asc_CDocInfo.prototype.put_VKey = asc_CDocInfo.prototype.asc_putVKey = function (v) {
this.VKey = v;
};
asc_CDocInfo.prototype.get_Token = asc_CDocInfo.prototype.asc_getToken = function () {
return this.Token;
};
asc_CDocInfo.prototype.put_Token = asc_CDocInfo.prototype.asc_putToken = function (v) {
this.Token = v;
};
asc_CDocInfo.prototype.get_OfflineApp = asc_CDocInfo.prototype.asc_getOfflineApp = function () {
return this.OfflineApp;
};
......
......@@ -341,6 +341,12 @@
}
};
CDocsCoApi.prototype.versionHistory = function(data) {
if (this._CoAuthoringApi && this._onlineWork) {
this._CoAuthoringApi.versionHistory(data);
}
};
CDocsCoApi.prototype.callback_OnAuthParticipantsChanged = function(e, count) {
if (this.onAuthParticipantsChanged) {
this.onAuthParticipantsChanged(e, count);
......@@ -806,6 +812,10 @@
this._send({'type': 'extendSession', 'idletime': idleTime});
};
DocsCoApi.prototype.versionHistory = function(data) {
this._send({'type': 'versionHistory', 'cmd': data});
};
DocsCoApi.prototype.openDocument = function(data) {
this._send({"type": "openDocument", "message": data});
};
......@@ -1295,7 +1305,7 @@
this.mode = docInfo.get_Mode();
this.permissions = docInfo.get_Permissions();
this.lang = docInfo.get_Lang();
this.jwt = docInfo.get_VKey();
this.jwt = docInfo.get_Token();
this.setDocId(docid);
this._initSocksJs();
......@@ -1494,12 +1504,10 @@
return Asc.c_oAscError.ID.CoAuthoringDisconnect;
} else if(c_oCloseCode.accessDeny === opt_closeCode) {
return Asc.c_oAscError.ID.CoAuthoringDisconnect;
} else if(c_oCloseCode.jwtEmptySecret === opt_closeCode) {
return Asc.c_oAscError.ID.CoAuthoringDisconnect;
} else if(c_oCloseCode.jwtExpired === opt_closeCode) {
return Asc.c_oAscError.ID.CoAuthoringDisconnect;
return Asc.c_oAscError.ID.KeyExpire;
} else if(c_oCloseCode.jwtError === opt_closeCode) {
return Asc.c_oAscError.ID.CoAuthoringDisconnect;
return Asc.c_oAscError.ID.VKeyEncrypt;
}
return this.isCloseCoAuthoring ? Asc.c_oAscError.ID.UserDrop : Asc.c_oAscError.ID.CoAuthoringDisconnect;
};
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment