mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-20 06:37:23 +02:00
feat: add read-only GitHub App access alongside OAuth
This commit is contained in:
1 parent
e5c44845f0
commit
a60ad6a921
49 files changed
+1754
-139
No files matched your search
@@ -145,6 +145,7 @@ export async function verifyCredentials(db: mongo.Db, cipher: Cipher) {
|
||||
let checked = 0;
|
||||
for await (const row of db.collection("credentials").find({})) {
|
||||
cipher.decrypt(row.encryptedToken as EncryptedToken, String(row.ownerId), row.provider);
|
||||
if (row.encryptedRefreshToken) cipher.decrypt(row.encryptedRefreshToken as EncryptedToken, String(row.ownerId), row.provider, "encryptedRefreshToken");
|
||||
if (!(await db.collection("users").findOne({ _id: row.ownerId, status: { $ne: "removed" } }))) {
|
||||
throw new Error("Credential has no active owner");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user