oidc: add initial findAccount and fixup findByUid
This commit is contained in:
+9
-1
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user