convert console.log to debug

This commit is contained in:
Girish Ramakrishnan
2023-04-30 10:18:39 +02:00
parent aa02d839a7
commit 898413bfd4
+9 -11
View File
@@ -218,7 +218,7 @@ class CloudronAdapter {
debug(`[${this.name}] upsert id:${id} expiresIn:${expiresIn}`, payload);
if (this.name === 'Client') {
console.log('WARNING!! this should not happen as it is stored in our db');
debug('upsert: this should not happen as it is stored in our db');
} else {
DATA_STORE[this.name][id] = { id, expiresIn, payload, consumed: false };
save(this.name);
@@ -241,7 +241,7 @@ class CloudronAdapter {
if (this.name === 'Client') {
const [error, client] = await safe(clientsGet(id));
if (error) {
console.log('Error getting client', error);
debug('find: error getting client', error);
return null;
}
if (!client) return null;
@@ -257,7 +257,7 @@ class CloudronAdapter {
if (client.appId) {
const [error, app] = await safe(apps.get(client.appId));
if (error || !app) {
console.error(`oidc: Unkown app for client with appId ${client.appId}`);
debug(`find: Unknown app for client with appId ${client.appId}`);
return null;
}
@@ -311,7 +311,7 @@ class CloudronAdapter {
debug(`[${this.name}] findByUid uid:${uid}`);
if (this.name === 'Client') {
console.log('WARNING!! this should not happen as it is stored in our db');
debug('findByUid: this should not happen as it is stored in our db');
} else {
for (let d in DATA_STORE[this.name]) {
if (DATA_STORE[this.name][d].payload.uid === uid) return DATA_STORE[this.name][d].payload;
@@ -336,7 +336,7 @@ class CloudronAdapter {
debug(`[${this.name}] consume id:${id}`);
if (this.name === 'Client') {
console.log('WARNING!! this should not happen as it is stored in our db');
debug('consume: this should not happen as it is stored in our db');
} else {
if (DATA_STORE[this.name][id]) DATA_STORE[this.name][id].consumed = true;
save(this.name);
@@ -357,7 +357,7 @@ class CloudronAdapter {
debug(`[${this.name}] destroy id:${id}`);
if (this.name === 'Client') {
console.log('WARNING!! this should not happen as it is stored in our db');
debug('destroy: this should not happen as it is stored in our db');
} else {
delete DATA_STORE[this.name][id];
save(this.name);
@@ -378,7 +378,7 @@ class CloudronAdapter {
debug(`[${this.name}] revokeByGrantId grantId:${grantId}`);
if (this.name === 'Client') {
console.log('WARNING!! this should not happen as it is stored in our db');
debug('revokeByGrantId: this should not happen as it is stored in our db');
} else {
for (let d in DATA_STORE[this.name]) {
if (DATA_STORE[this.name][d].grantId === grantId) {
@@ -437,9 +437,7 @@ function renderInteractionPage(provider) {
return undefined;
}
} catch (error) {
debug('route interaction get error');
console.log(error);
debug('route interaction get error', error);
return next(error);
}
};
@@ -719,7 +717,7 @@ async function start() {
keys: [ 'cookiesecret1', 'cookiesecret2' ]
},
pkce: {
required: function pkceRequired(ctx, client) {
required: function pkceRequired(/*ctx, client*/) {
return false;
}
},