mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-24 22:11:03 +02:00
Improve error handling
This commit is contained in:
+10
-1
@@ -179,7 +179,16 @@ export async function getToken(repository: Repository) {
|
||||
} else {
|
||||
repository.owner.model.accessTokenDates.github = new Date();
|
||||
}
|
||||
await repository.owner.model.save();
|
||||
await UserModel.updateOne(
|
||||
{ _id: repository.owner.model._id },
|
||||
{
|
||||
$set: {
|
||||
"accessTokens.github": refreshed,
|
||||
"accessTokenDates.github":
|
||||
repository.owner.model.accessTokenDates.github,
|
||||
},
|
||||
}
|
||||
).exec();
|
||||
return refreshed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user