amélioration de la 2Fa
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user