refactor: abstract exception capture out of is-still-verified

This commit is contained in:
Ali BARIN
2022-11-08 19:48:54 +01:00
parent dbceed563a
commit d2b0a57064
10 changed files with 29 additions and 60 deletions

View File

@@ -22,7 +22,12 @@ const testConnection = async (
const app = await App.findOneByKey(connection.key, false);
const $ = await globalVariable({ connection, app });
const isStillVerified = await app.auth.isStillVerified($);
let isStillVerified;
try {
isStillVerified = !!(await app.auth.isStillVerified($));
} catch {
isStillVerified = false;
}
connection = await connection.$query().patchAndFetch({
formattedData: connection.formattedData,