Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
hu8813 committed Apr 29, 2024
1 parent 24d5108 commit cdaa5ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions srcs/backend/myproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
'c3r1p5.42vienna.com',
'c3r1p2.42vienna.com',
'c3r1p3.42vienna.com',
'10.13.1.5',
'10.13.1.1',
'localhost:5500',
'localhost:8443',
'localhost:443',
Expand Down Expand Up @@ -195,6 +197,8 @@
'https://10.13.1.2:8443',
'https://10.13.1.3:8443',
'https://10.13.1.4:8443',
'https://10.13.1.5:8443',
'https://10.13.1.5',
'http://127.0.0.1',
'https://127.0.0.1:8000',
'https://127.0.0.1',
Expand Down Expand Up @@ -234,9 +238,12 @@
'https://127.0.0.1:8000',
'https://127.0.0.1',
'https://10.13.1.1:8443',
'https://10.13.1.1',
'https://10.13.1.2:8443',
'https://10.13.1.3:8443',
'https://10.13.1.4:8443',
'https://10.13.1.5:8443',
'https://10.13.1.5',
'https://c3r1p1.42vienna.com',
'https://c3r1p3.42vienna.com',
'https://c3r1p4.42vienna.com',
Expand Down
10 changes: 8 additions & 2 deletions srcs/frontend/js/manage2fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ async function display2faPage() {
const csrfToken = await getCSRFCookie();

const activationCode = document.getElementById('activationCode').value;
//console.log(activationCode)

if (!activationCode || !(/^\d{6}$/.test(activationCode))) {
displayError('Activation code must be a 6-digit numeric value.');
return;
}

const response = await fetch(`/api/2fa-activate`, {
method: 'POST',
body: JSON.stringify({ activationCode }),
Expand All @@ -103,7 +108,7 @@ async function display2faPage() {
document.getElementById('qrCodeSection').style.display = 'none';
document.getElementById('qrCode').innerHTML = '';
document.getElementById('activationCode').value = '';
document.getElementById('errorLabel').textContent = '';
document.getElementById('errorLabel').textContent = '';
//location.reload();
} else {
const responseData = await response.json();
Expand All @@ -115,6 +120,7 @@ async function display2faPage() {
}
}


async function generateQRCode() {
try {
const jwtToken = localStorage.getItem('jwtToken');
Expand Down

0 comments on commit cdaa5ca

Please sign in to comment.