Weiter an der Konfig Maske für das BDSM Game gearbeitet, Refactoring der Controller Klassen
This commit is contained in:
@@ -42,14 +42,6 @@
|
||||
if (e.key === 'Enter') register();
|
||||
});
|
||||
|
||||
async function sha256(text) {
|
||||
const encoder = new TextEncoder();
|
||||
const data = encoder.encode(text);
|
||||
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
||||
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
|
||||
async function register() {
|
||||
const name = document.getElementById('name').value.trim();
|
||||
const email = document.getElementById('email').value.trim();
|
||||
@@ -84,11 +76,10 @@
|
||||
hideMessage();
|
||||
|
||||
try {
|
||||
const passwordHash = await sha256(password);
|
||||
const response = await fetch('/registration', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name, email, passwordHash, geburtsdatum })
|
||||
body: JSON.stringify({ name, email, password, geburtsdatum })
|
||||
});
|
||||
|
||||
if (response.status === 202) {
|
||||
|
||||
Reference in New Issue
Block a user