oidc: remove dead code

This commit is contained in:
Johannes Zellner
2023-03-14 13:54:36 +01:00
parent 51831e4bdf
commit 2038a98e61

View File

@@ -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