push service

This commit is contained in:
toni
2026-03-13 21:54:43 +01:00
parent 71ca4d81e1
commit 29c6828dd1
23 changed files with 526 additions and 137 deletions
@@ -31,6 +31,9 @@ export class KeycloakUser {
this.keycloakConnect = new Promise(async resolve => {
const config = await this.getConfig();
const client = new KeycloakConnect({ store: sessionStore }, config);
client.authenticated=(r)=>{
console.dir(r);
};
resolve(client);
});
}
@@ -49,4 +52,10 @@ export class KeycloakUser {
const client = await this.keycloakConnect;
return client.middleware();
}
public async getUid(request: Request, response?: Response): Promise<string>{
const client = await this.keycloakConnect;
const grant = await client.getGrant(request, response ?? ({} as any));
return (grant.access_token as any)?.content?.sub;
}
}