fix: encrypt stored GitHub credentials (#797)

This commit is contained in:
Thomas Durieux
2026-09-08 13:04:28 +02:00
committed by GitHub
parent b070d7e281
commit 3fb376dd53
32 changed files with 1098 additions and 188 deletions
+1 -16
View File
@@ -70,23 +70,8 @@ export default class Repository {
this.owner.model.isNew = false;
}
private checkedToken: boolean = false;
async getToken() {
if (this.checkedToken) return this._model.source.accessToken as string;
const originalToken = this._model.source.accessToken;
const token = await getToken(this);
if (originalToken != token) {
this._model.source.accessToken = token;
if (isConnected) {
await AnonymizedRepositoryModel.updateOne(
{ _id: this._model._id },
{ $set: { "source.accessToken": token } }
).exec();
}
}
this.checkedToken = true;
return token;
return getToken(this);
}
get source() {