Update codebase

This commit is contained in:
Hamza-Ayed
2026-07-16 16:01:28 +03:00
parent 951f6d80e1
commit 83f2d0854a
16 changed files with 343 additions and 48 deletions
@@ -0,0 +1,26 @@
import { Controller, Post, Body, Headers, UnauthorizedException } from '@nestjs/common';
import { AuthService } from './auth.service';
@Controller('auth')
export class AuthController {
constructor(private readonly authService: AuthService) {}
@Post('send-otp')
async sendOtp(
@Headers('x-tenant-id') tenantId: string,
@Body('phone') phone: string,
) {
if (!tenantId) throw new UnauthorizedException('Tenant ID (x-tenant-id) is required');
return this.authService.sendOtp(tenantId, phone);
}
@Post('verify-otp')
async verifyOtp(
@Headers('x-tenant-id') tenantId: string,
@Body('phone') phone: string,
@Body('code') code: string,
) {
if (!tenantId) throw new UnauthorizedException('Tenant ID (x-tenant-id) is required');
return this.authService.verifyOtp(tenantId, phone, code);
}
}