Initial commit: HealthCarePregnant project documentation and platform
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
import { AuthService, RegisterInput } from './auth.service';
|
||||
import { AuthResult } from './auth.types';
|
||||
import { Public } from '../../common/auth/public.decorator';
|
||||
|
||||
@Public()
|
||||
@Controller('auth')
|
||||
export class AuthController {
|
||||
constructor(private readonly auth: AuthService) {}
|
||||
|
||||
@Post('register')
|
||||
register(@Body() body: RegisterInput): Promise<AuthResult> {
|
||||
return this.auth.register(body);
|
||||
}
|
||||
|
||||
@Post('login')
|
||||
login(@Body() body: { username: string; password: string }): Promise<AuthResult> {
|
||||
return this.auth.login(body.username, body.password);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user