changements mineurs
This commit is contained in:
@@ -52,22 +52,19 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const settingsHandler = async() => {
|
const settingsHandler = async() => {
|
||||||
let valid = false;
|
|
||||||
|
|
||||||
// I don't really care which i use at this point...
|
// I don't really care which i use at this point...
|
||||||
// if (set.username === nameTmp) {
|
// if (set.username === nameTmp) {
|
||||||
if ((set.username.trim() === '')) {
|
if ((set.username.trim() === '') && set.tfa === user.isEnabledTwoFactorAuth) {
|
||||||
errors.username = 'Invalid new username';
|
errors.username = 'Invalid new username';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (set.username === user.username){
|
else if ((set.username.trim() === '') && set.tfa !== user.isEnabledTwoFactorAuth) {
|
||||||
errors.username = "You must choose a different username than the previous"
|
set.username = user.username
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
errors.username = '';
|
errors.username = '';
|
||||||
}
|
}
|
||||||
const res = await fetch('http://transcendance:8080/api/v2/user',{
|
await fetch('http://transcendance:8080/api/v2/user',{
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
|||||||
Reference in New Issue
Block a user