Skip to content

Commit

Permalink
Merge pull request #24 from Abby-Wheelis/fix-autogen-choice
Browse files Browse the repository at this point in the history
Update OPCODE_AUTOGEN conditions
  • Loading branch information
shankari authored Oct 19, 2023
2 parents 2cd1f6e + f4b4df2 commit b8c31a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,14 @@ <h2 data-i18n="contact">Contact</h2>
console.log("Dynamic Config result is", data);

//create token and token url
OPCODE_AUTOGEN = data.opcode?.autogen || data.intro.program_or_study == "study";
if(typeof data.opcode?.autogen !== 'undefined') { //if the autogen property is set, use it
console.log("found opcode setting, is", data.opcode.autogen);
OPCODE_AUTOGEN = data.opcode?.autogen;
} else { //else fall back to program vs study
console.log("falling back to program vs study", data.intro.program_or_study);
OPCODE_AUTOGEN = data.intro.program_or_study == "study";
}

if (OPCODE_AUTOGEN) {
validateAndGenerateToken();
} else {
Expand Down

0 comments on commit b8c31a7

Please sign in to comment.