From 2038a98e61133da7cb6eef52e9104a837fd8d001 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 14 Mar 2023 13:54:36 +0100 Subject: [PATCH] oidc: remove dead code --- src/oidc.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/src/oidc.js b/src/oidc.js index fc2256aeb..555b1f433 100644 --- a/src/oidc.js +++ b/src/oidc.js @@ -174,42 +174,6 @@ class CloudronAdapter { } } -const store = new Map(); -const logins = new Map(); - -class Account { - constructor(id, profile) { - this.accountId = id || 'FIXME_someid'; - this.profile = profile; - store.set(this.accountId, this); - } - - - static async findByFederated(provider, claims) { - const id = `${provider}.${claims.sub}`; - if (!logins.get(id)) { - logins.set(id, new Account(id, claims)); - } - return logins.get(id); - } - - static async findByLogin(login) { - if (!logins.get(login)) { - logins.set(login, new Account(login)); - } - - return logins.get(login); - } - - static async findAccount(ctx, id, token) { // eslint-disable-line no-unused-vars - // token is a reference to the token used for which a given account is being loaded, - // it is undefined in scenarios where account claims are returned from authorization endpoint - // ctx is the koa request context - if (!store.get(id)) new Account(id); // eslint-disable-line no-new - return store.get(id); - } -} - function attachInteractionRoutes(routePrefix, app, provider) { assert.strictEqual(typeof routePrefix, 'string'); assert.strictEqual(typeof app, 'function'); // express app