Yggdrasil/data/static/register.js
2026-01-19 20:26:58 +01:00

20 lines
626 B
JavaScript

async function register() {
const response = await fetch("https://yggdrasil.azures.fr/register", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
email: email.value,
username: username.value,
password: password.value
})
})
const json = await response.json()
if (json.code != 200) {
return iziToast.error({ title: json.error, message: json.message })
} else {
console.log(json)
return iziToast.success({ title: "Succès", message: json.message })
}
}