20 lines
626 B
JavaScript
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 })
|
|
}
|
|
} |