feat(auth): add OIDC login page for Matrix SSO

Add a simple login page at /login for OIDC authorization flows.
When users access the authorization endpoint without being logged in,
Better Auth redirects them to this page. After successful login,
users are redirected back to continue the authorization flow.

- Create OidcLoginController with login page HTML
- Add controller to AuthModule
- Exclude /login from global prefix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-01-29 12:55:02 +01:00
parent 0c1008d725
commit 29c5d2b29a
3 changed files with 257 additions and 1 deletions

View file

@ -2,12 +2,13 @@ import { Module, forwardRef } from '@nestjs/common';
import { AuthController } from './auth.controller';
import { BetterAuthPassthroughController } from './better-auth-passthrough.controller';
import { OidcController } from './oidc.controller';
import { OidcLoginController } from './oidc-login.controller';
import { BetterAuthService } from './services/better-auth.service';
import { ReferralsModule } from '../referrals/referrals.module';
@Module({
imports: [forwardRef(() => ReferralsModule)],
controllers: [AuthController, BetterAuthPassthroughController, OidcController],
controllers: [AuthController, BetterAuthPassthroughController, OidcController, OidcLoginController],
providers: [BetterAuthService],
exports: [BetterAuthService],
})