mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-16 13:38:41 +00:00
* eslint-setup: rules for frontend and server * setup pre-commit:hook * frontend:eslint fixes * frontend eslint errors and warning fixed * eslint:fix for ./server * fix server/test: expectatin string lint/error * pre-commit:updated * removed unwanted install cmd from docker file * recommended settings and extension for vscode * husky prepare script added * updated extension recommendations * added prettier as recommended extension * added pre-commit to package.json * remove .prettierrc file * resolve changes * resolve changes
41 lines
1,020 B
TypeScript
41 lines
1,020 B
TypeScript
import { Controller, Get, Request, Post } from '@nestjs/common';
|
|
import { AuthService } from '../services/auth.service';
|
|
|
|
@Controller()
|
|
export class AppController {
|
|
constructor(private authService: AuthService) {}
|
|
|
|
@Post('authenticate')
|
|
async login(@Request() req) {
|
|
return this.authService.login(req.body);
|
|
}
|
|
|
|
@Post('signup')
|
|
async signup(@Request() req) {
|
|
return this.authService.signup(req.body);
|
|
}
|
|
|
|
@Post('/forgot_password')
|
|
async forgotPassword(@Request() req) {
|
|
await this.authService.forgotPassword(req.body.email);
|
|
return {};
|
|
}
|
|
|
|
@Post('/reset_password')
|
|
async resetPassword(@Request() req) {
|
|
const { token, password } = req.body;
|
|
await this.authService.resetPassword(token, password);
|
|
return {};
|
|
}
|
|
|
|
@Get('/health')
|
|
async healthCheck(@Request() req) {
|
|
return { works: 'yeah' };
|
|
}
|
|
|
|
// TODO: Added to debug intermittent failures when paired with proxy
|
|
@Post('/health')
|
|
async postHealthCheck(@Request() req) {
|
|
return { works: 'yeah' };
|
|
}
|
|
}
|