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