Skip to content

Commit

Permalink
fixes hashing script
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmonteiro committed Aug 23, 2024
1 parent 0bc44b3 commit d0efae5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Secure Toggle</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.js"></script>
</head>
<body>
<label for="switch">Switch:</label>
Expand All @@ -13,6 +12,7 @@
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.13.0/firebase-app.js";
import { getDatabase, ref, set, get, onValue } from "https://www.gstatic.com/firebasejs/10.13.0/firebase-database.js";
import { SHA256 } from 'https://cdn.skypack.dev/[email protected]';

// Your Firebase configuration
const firebaseConfig = {
Expand All @@ -35,7 +35,7 @@

if (accessToken) {
// Hash the token using SHA-256
const hashedToken = CryptoJS.SHA256(accessToken).toString();
const hashedToken = SHA256(accessToken).toString();

// Reference to validate token
const validTokensRef = ref(database, 'validTokens/' + hashedToken);
Expand Down

0 comments on commit d0efae5

Please sign in to comment.