amélioration de la 2Fa

This commit is contained in:
batche
2022-12-07 19:59:05 +01:00
parent 1a584483e7
commit bccb342043
9 changed files with 71 additions and 62 deletions

View File

@@ -33,7 +33,7 @@
})()
const submitCode = async() => {
const response = await fetch("http://transcendance:8080/api/v2/auth/2fa/turn-on",
const response = await fetch("http://transcendance:8080/api/v2/auth/2fa/check",
{
method : 'POST',
headers : {
@@ -48,9 +48,8 @@
wrongCode = `Wrong code`;
}
if (response.status === 200) {
userLogout();
push('/profile');
console.log('vaid Code for 2FA')
console.log('valid Code for 2FA')
}
};
@@ -106,4 +105,4 @@
font-size: 0.8em;
color: red;
}
</style>
</style>

View File

@@ -18,7 +18,7 @@
onMount( async() => {
user = await fetch('http://transcendance:8080/api/v2/user')
.then( (x) => x.json() );
// do a .catch?
// do a .catch?
if (user === undefined) {
console.log('User did not load, something more official should prolly happen')
@@ -77,7 +77,7 @@
.then(response => response.json())
// .then((result) => console.log(result))
// .then(() => console.log('successful sub of new settings'))
.then(() => push('/profile'));
}
};
@@ -203,4 +203,4 @@
}
</style>
</style>

View File

@@ -150,7 +150,7 @@ export const primaryRoutes = {
const user = await fetch('http://transcendance:8080/api/v2/user')
.then((resp) => resp.json())
console.log('in /test what is in user')
console.log('in /profile what is in user')
console.log(user)
if (user && user.username)
@@ -167,7 +167,7 @@ export const primaryRoutes = {
const user = await fetch('http://transcendance:8080/api/v2/user')
.then((resp) => resp.json())
console.log('in /test what is in user')
console.log('in /profile/* what is in user')
console.log(user)
if (user && user.username)