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>
pull/9092/head
Ashod Nakashian 2024-05-15 20:52:27 -04:00 committed by Ashod Nakashian
parent f7892edd86
commit e14b84c542
1 changed files with 7 additions and 1 deletions

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) {