From e35b36643cf989c0c509177549d6e128e630d84c Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 18 Nov 2024 17:17:22 +0100 Subject: [PATCH] Add more oidc debugs --- src/oidc.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/oidc.js b/src/oidc.js index 3fc2d9638..55da24017 100644 --- a/src/oidc.js +++ b/src/oidc.js @@ -238,7 +238,7 @@ class CloudronAdapter { constructor(name) { this.name = name; - // debug(`Creating OpenID storage adapter for ${name}`); + debug(`Creating OpenID storage adapter for ${name}`); if (this.name === 'Client') { return; @@ -260,6 +260,8 @@ class CloudronAdapter { * */ async upsert(id, payload, expiresIn) { + debug(`[${this.name}] upsert: ${id}`); + if (this.name === 'Client') { debug('upsert: this should not happen as it is stored in our db'); } else if (this.name === 'AccessToken' && (payload.clientId === tokens.ID_WEBADMIN || payload.clientId === tokens.ID_DEVELOPMENT)) { @@ -290,6 +292,8 @@ class CloudronAdapter { * */ async find(id) { + debug(`[${this.name}] find: ${id}`); + if (this.name === 'Client') { const [error, client] = await safe(clientsGet(id)); if (error) { @@ -329,10 +333,9 @@ class CloudronAdapter { return tmp; } else if (this.name === 'AccessToken') { - debug('find: we dont support finding AccessTokens', id); const [error, result] = await safe(tokens.getByAccessToken(id)); if (error || !result) { - debug(`find: Unknown accessToken for id ${id} maybe oidc internal?`); + debug(`find: ${id} is not an API accessToken maybe oidc internal`); if (!DATA_STORE[this.name][id]) return null; return DATA_STORE[this.name][id].payload; @@ -377,6 +380,8 @@ class CloudronAdapter { * */ async findByUid(uid) { + debug(`[${this.name}] findByUid: ${uid}`); + if (this.name === 'Client' || this.name === 'AccessToken') { debug('findByUid: this should not happen as it is stored in our db'); } else { @@ -421,7 +426,7 @@ class CloudronAdapter { * */ async destroy(id) { - // debug(`[${this.name}] destroy: ${id}`); + debug(`[${this.name}] destroy: ${id}`); if (this.name === 'Client') { debug('destroy: this should not happen as it is stored in our db');