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