Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
PepikVaio authored Jan 9, 2024
1 parent a798ebc commit a11e35a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
document.getElementById('showQRButton').addEventListener('click', function() {
var enteredCode = document.getElementById('codeInput').value;
var correctCode = '{{ secrets.MY_CODE }}'; // Získání hodnoty z GitHub Secret

var enteredCode = process.env.ENTERED_CODE; // Získání hodnoty z prostředí
var correctCode = process.env.MY_CODE; // Získání hodnoty z GitHub Secret prostředí
if (enteredCode === correctCode) {
// Otevření vyskakovacího okna
document.getElementById('myModal').style.display = 'block';
console.log('Code is correct!');
} else {
alert('Nesprávný kód. Zkuste to znovu.');
console.error('Incorrect code!');
process.exit(1); // Ukončení s chybou
}
});

Expand Down

0 comments on commit a11e35a

Please sign in to comment.