Skip to content

Commit

Permalink
Updated decode-loginsession to work with GenerateAccessTokenForApp
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorMcKay committed Apr 24, 2023
1 parent 8affa16 commit 287a278
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/decode-loginsession.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ if (!process.argv[2] || !FS.existsSync(process.argv[2])) {
process.exit(1);
}

const METHOD_TO_PROTOBUF_MAP = {
GenerateAccessTokenForApp: 'AccessToken_GenerateForApp'
};

let har;
let output = [];
try {
Expand All @@ -27,8 +31,9 @@ har.log.entries.forEach(({request, response}) => {
}

let apiMethod = match[1];
let requestProto = Protos[`CAuthentication_${apiMethod}_Request`];
let responseProto = Protos[`CAuthentication_${apiMethod}_Response`];
let protoName = METHOD_TO_PROTOBUF_MAP[apiMethod] || apiMethod;
let requestProto = Protos[`CAuthentication_${protoName}_Request`];
let responseProto = Protos[`CAuthentication_${protoName}_Response`];
if (!requestProto || !responseProto) {
return;
}
Expand Down

0 comments on commit 287a278

Please sign in to comment.