mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 23:56:43 +02:00
feat(bots): enable Redis SSO for todo-bot and calendar-bot
- Activate Redis session storage in both bots for cross-bot SSO - Update SessionHelper to async methods for Redis-backed SessionService - Fix async/await issues in todo-bot and calendar-bot matrix.service.ts - Remove unused imports from calendar-api and todo-api services - Add CALENDAR_BACKEND_URL and MANA_CORE_SERVICE_KEY to .env.development Note: SessionService methods are now async (Redis-backed). Other bots need their matrix.service.ts updated to await these async calls. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
7bad849258
commit
2777f604fd
27 changed files with 2997 additions and 838 deletions
|
|
@ -206,11 +206,13 @@ Daten von Umami Analytics (self-hosted).`;
|
|||
const result = await this.sessionService.login(sender, email, password);
|
||||
|
||||
if (result.success) {
|
||||
const token = this.sessionService.getToken(sender);
|
||||
const token = await this.sessionService.getToken(sender);
|
||||
if (token) {
|
||||
const balance = await this.creditService.getBalance(token);
|
||||
await this.sendMessage(roomId,
|
||||
`✅ Erfolgreich angemeldet als **${email}**\n⚡ Credits: ${balance.balance.toFixed(2)}`);
|
||||
await this.sendMessage(
|
||||
roomId,
|
||||
`✅ Erfolgreich angemeldet als **${email}**\n⚡ Credits: ${balance.balance.toFixed(2)}`
|
||||
);
|
||||
} else {
|
||||
await this.sendMessage(roomId, `✅ Erfolgreich angemeldet als **${email}**`);
|
||||
}
|
||||
|
|
@ -220,14 +222,14 @@ Daten von Umami Analytics (self-hosted).`;
|
|||
}
|
||||
|
||||
private async handleLogout(roomId: string, sender: string) {
|
||||
this.sessionService.logout(sender);
|
||||
await this.sessionService.logout(sender);
|
||||
await this.sendMessage(roomId, '👋 Erfolgreich abgemeldet.');
|
||||
}
|
||||
|
||||
private async handleStatus(roomId: string, sender: string) {
|
||||
const loggedIn = this.sessionService.isLoggedIn(sender);
|
||||
const session = this.sessionService.getSession(sender);
|
||||
const token = this.sessionService.getToken(sender);
|
||||
const loggedIn = await this.sessionService.isLoggedIn(sender);
|
||||
const session = await this.sessionService.getSession(sender);
|
||||
const token = await this.sessionService.getToken(sender);
|
||||
|
||||
let response = '**📊 Stats Bot Status**\n\n';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue