oidc: add initial findAccount and fixup findByUid

This commit is contained in:
Johannes Zellner
2023-03-09 19:16:36 +01:00
parent 47e35d0b06
commit 1ea76ebb60
+9 -1
View File
@@ -106,7 +106,7 @@ class CloudronAdapter {
debug(`[${this.name}] findByUid uid:${uid}`);
for (let d in this.store) {
if (this.store[d].uid === uid) return this.store[d].payload;
if (this.store[d].payload.uid === uid) return this.store[d].payload;
}
return false;
@@ -171,6 +171,14 @@ async function getProvider() {
const { Provider } = await import('oidc-provider');
const configuration = {
async findAccount(ctx, id) {
debug(`findAccount ctx:${ctx} id:${id}`);
return {
accountId: id,
async claims(use, scope) { return { sub: id }; },
};
},
adapter: CloudronAdapter,
clients: [{
client_id: 'foo',