oidc: comment out some debugs

This commit is contained in:
Girish Ramakrishnan
2023-07-25 12:22:54 +05:30
parent 9a359a27f5
commit ecc4d58bb2
+6 -6
View File
@@ -143,7 +143,7 @@ function load(modelName) {
if (DATA_STORE[modelName]) return; if (DATA_STORE[modelName]) return;
const filePath = path.join(paths.OIDC_STORE_DIR, `${modelName}.json`); const filePath = path.join(paths.OIDC_STORE_DIR, `${modelName}.json`);
debug(`load: model ${modelName} based on ${filePath}.`); // debug(`load: model ${modelName} based on ${filePath}.`);
let data = {}; let data = {};
try { try {
@@ -162,7 +162,7 @@ function save(modelName) {
if (!DATA_STORE[modelName]) return; if (!DATA_STORE[modelName]) return;
const filePath = path.join(paths.OIDC_STORE_DIR, `${modelName}.json`); const filePath = path.join(paths.OIDC_STORE_DIR, `${modelName}.json`);
debug(`save: model ${modelName} to ${filePath}.`); // debug(`save: model ${modelName} to ${filePath}.`);
try { try {
fs.writeFileSync(filePath, JSON.stringify(DATA_STORE[modelName], null, 2), 'utf8'); fs.writeFileSync(filePath, JSON.stringify(DATA_STORE[modelName], null, 2), 'utf8');
@@ -212,7 +212,7 @@ class CloudronAdapter {
constructor(name) { constructor(name) {
this.name = name; this.name = name;
debug(`Creating OpenID storage adapter for ${name}`); // debug(`Creating OpenID storage adapter for ${name}`);
if (this.name === 'Client') { if (this.name === 'Client') {
return; return;
@@ -389,7 +389,7 @@ class CloudronAdapter {
* *
*/ */
async destroy(id) { async destroy(id) {
debug(`[${this.name}] destroy: ${id}`); // debug(`[${this.name}] destroy: ${id}`);
if (this.name === 'Client') { if (this.name === 'Client') {
debug('destroy: this should not happen as it is stored in our db'); debug('destroy: this should not happen as it is stored in our db');
@@ -534,7 +534,7 @@ function interactionLogin(provider) {
await eventlog.add(user.ghost ? eventlog.ACTION_USER_LOGIN_GHOST : eventlog.ACTION_USER_LOGIN, auditSource, { userId: user.id, user: users.removePrivateFields(user) }); await eventlog.add(user.ghost ? eventlog.ACTION_USER_LOGIN_GHOST : eventlog.ACTION_USER_LOGIN, auditSource, { userId: user.id, user: users.removePrivateFields(user) });
if (!user.ghost) safe(users.notifyLoginLocation(user, ip, userAgent, auditSource), { debug }); if (!user.ghost) safe(users.notifyLoginLocation(user, ip, userAgent, auditSource), { debug });
debug(`route interaction login post result redirectTo:${redirectTo}`); // debug(`route interaction login post result redirectTo:${redirectTo}`);
res.status(200).send({ redirectTo }); res.status(200).send({ redirectTo });
}; };
@@ -634,7 +634,7 @@ function interactionAbort(provider) {
* loading some claims from external resources etc. based on this detail * loading some claims from external resources etc. based on this detail
* or not return them in id tokens but only userinfo and so on. * or not return them in id tokens but only userinfo and so on.
*/ */
async function claims(userId, use, scope) { async function claims(userId/*, use, scope*/) {
const [error, user] = await safe(users.get(userId)); const [error, user] = await safe(users.get(userId));
if (error) return { error: 'user not found' }; if (error) return { error: 'user not found' };