Add more oidc debugs

This commit is contained in:
Johannes Zellner
2024-11-18 17:17:22 +01:00
parent 16fa339025
commit e35b36643c
+9 -4
View File
@@ -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');