mirror of
https://github.com/outline/outline.git
synced 2026-11-22 22:02:35 +03:00
Restore retry on all invalid
This commit is contained in:
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,
|
||||
|
||||
Reference in new issue
Block a user