browser: display unauthorized error message

It seems there are two handler for this message.
Since we moved the authentication logic ahead
of the web-socket upgrade, the handler for
the unauthorized error doesn't display the
message. This fixes the it so now we correctly
display the unauthorized message.

Change-Id: Ic62476c74ce1583a2d7f33e1233e6fafd43d3bc4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
Ashod Nakashian 2024-05-15 20:52:27 -04:00 committed by Ashod Nakashian
parent f7892edd86
commit e14b84c542

View file

@ -988,7 +988,13 @@ app.definitions.Socket = L.Class.extend({
this._map.fire('error', {msg: errorMessages.diskfull});
}
else if (command.errorKind === 'unauthorized') {
this._map.fire('error', {msg: errorMessages.unauthorized});
var postMessageObj = {
errorType: 'websocketunauthorized',
success: false,
errorMsg: errorMessages.unauthorized,
result: '',
};
this._map.fire('postMessage', { msgId: 'Action_Load_Resp', args: postMessageObj });
}
if (this._map._docLayer) {