Skip to content

Commit

Permalink
[refactor] Refactoring in 'auth'
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Nov 29, 2024
1 parent 5b96913 commit b66be80
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions DocService/sources/DocsCoServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2538,14 +2538,15 @@ exports.install = function(server, callbackFunction) {
let validationErr = validateAuthToken(data, decoded);
if (!validationErr) {
fillDataFromJwtRes = fillDataFromJwt(ctx, decoded, data);
} else if (tenTokenRequiredParams) {
ctx.logger.error("auth missing required parameter %s (since 7.1 version)", validationErr);
sendDataDisconnectReason(ctx, conn, constants.JWT_ERROR_CODE, constants.JWT_ERROR_REASON);
conn.disconnect(true);
return;
} else {
ctx.logger.warn("auth missing required parameter %s (since 7.1 version)", validationErr);
fillDataFromJwtRes = fillDataFromJwt(ctx, decoded, data);
ctx.logger.error("auth missing required parameter %s (since 7.1 version)", validationErr);
if (tenTokenRequiredParams) {
sendDataDisconnectReason(ctx, conn, constants.JWT_ERROR_CODE, constants.JWT_ERROR_REASON);
conn.disconnect(true);
return;
} else {
fillDataFromJwtRes = fillDataFromJwt(ctx, decoded, data);
}
}
}
if(!fillDataFromJwtRes) {
Expand Down

0 comments on commit b66be80

Please sign in to comment.