push service
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user