Skip to content
Snippets Groups Projects
Commit b313e148 authored by Ewen Le Bihan's avatar Ewen Le Bihan
Browse files

refactor(login): remove useless nested try-catch blocks

parent 452a9847
Branches
Tags v0.16.6
No related merge requests found
......@@ -171,7 +171,6 @@ builder.mutationField('login', (t) =>
user.uid
);
if (!ldapUser) {
try {
// Try to find them in the school's LDAP
const schoolUser = await getSupannAliasLogin(user.email);
// eslint-disable-next-line max-depth, no-negated-condition
......@@ -186,7 +185,6 @@ builder.mutationField('login', (t) =>
// Create the LDAP entry
await log('login/ldap-sync', 'start', { user }, user.uid);
const schoolEmail = `${schoolUser.supannAliasLogin}@etu.inp-n7.fr`;
try {
await createLdapUser(
{
...user,
......@@ -202,12 +200,6 @@ builder.mutationField('login', (t) =>
schoolUid: schoolUser.schoolUid,
},
});
} catch (error) {
await log('login/ldap-sync', 'error', { err: error }, user.uid);
}
}
} catch (error) {
await log('login/ldap-sync', 'error', { err: error }, user.uid);
}
}
} catch (error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment