Restore retry on all invalid

This commit is contained in:
Tom Moor committed 2025-03-19 21:25:03 -04:00
1 parent 7548fe36db
commit 2bd89b9c60
1 file changed
+7
@@ -20,11 +20,13 @@ export default class ValidateSSOAccessTask extends BaseTask<Props> {
}
// Check the validity of the user's authentications.
let error;
const validity = await Promise.all(
userAuthentications.map(async (authentication) => {
try {
return await authentication.validateAccess({ transaction });
} catch (err) {
error = err;
return false;
}
})
@@ -34,6 +36,11 @@ export default class ValidateSSOAccessTask extends BaseTask<Props> {
return;
}
// If an unexpected error occurred, throw it to trigger a retry.
if (error) {
throw error;
}
// If all are invalid then we need to revoke the users Outline sessions.
const user = await User.findByPk(userId, {
transaction,