ToolJet/server/src/controllers/app.controller.ts
Arpit 26c9cc655c
Fix linting errors across the app (#785)
* 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
2021-09-21 19:18:28 +05:30

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' };
}
}