🐛 fix(matrix-web): handle Matrix SSO loginToken callback

Add loginWithLoginToken function to exchange Matrix SSO loginToken for credentials.
The app layout now detects the loginToken URL parameter and completes the SSO flow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-02-01 15:02:47 +01:00
parent 9e9db590dc
commit dc0d425f61
53 changed files with 1550 additions and 230 deletions

View file

@ -4,9 +4,16 @@ import { CommandRouterService } from './command-router.service';
import { HandlersModule } from '../handlers/handlers.module';
import { OrchestrationModule } from '../orchestration/orchestration.module';
import { VoiceModule } from '../voice/voice.module';
import { SessionModule, CreditModule } from '@manacore/bot-services';
@Module({
imports: [forwardRef(() => HandlersModule), forwardRef(() => OrchestrationModule), VoiceModule],
imports: [
forwardRef(() => HandlersModule),
forwardRef(() => OrchestrationModule),
VoiceModule,
SessionModule.forRoot(),
CreditModule.forRoot(),
],
providers: [MatrixService, CommandRouterService],
exports: [MatrixService, CommandRouterService],
})

View file

@ -67,6 +67,18 @@ export class CommandRouterService {
description: 'Show help',
},
// Auth Commands
{
patterns: ['!login'],
handler: (ctx, args) => this.helpHandler.handleLogin(ctx, args),
description: 'Login with email and password',
},
{
patterns: ['!logout'],
handler: (ctx) => this.helpHandler.handleLogout(ctx),
description: 'Logout',
},
// AI Commands
{
patterns: ['!models', '!modelle'],

View file

@ -4,6 +4,7 @@ import { BaseMatrixService, MatrixBotConfig, MatrixRoomEvent } from '@manacore/m
import { CommandRouterService, CommandContext } from './command-router.service';
import { VoiceService, VoiceServiceError } from '../voice/voice.service';
import { VoiceFormatterService } from '../voice/voice-formatter.service';
import { SessionService, CreditService } from '@manacore/bot-services';
import { HELP_TEXT, WELCOME_TEXT, BOT_INTRODUCTION } from '../config/configuration';
@Injectable()
@ -16,7 +17,9 @@ export class MatrixService extends BaseMatrixService {
private commandRouter: CommandRouterService,
@Inject(forwardRef(() => VoiceService))
private voiceService: VoiceService,
private voiceFormatter: VoiceFormatterService
private voiceFormatter: VoiceFormatterService,
private sessionService: SessionService,
private creditService: CreditService
) {
super(configService);
this.voiceEnabled = configService.get('voice.enabled') !== false;