mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: remove organization name in register form.
This commit is contained in:
@@ -2,10 +2,9 @@ import { Request, Response, Router } from 'express';
|
||||
import { check, ValidationChain } from 'express-validator';
|
||||
import { Service, Inject } from 'typedi';
|
||||
import BaseController from 'api/controllers/BaseController';
|
||||
import validateMiddleware from 'api/middleware/validateMiddleware';
|
||||
import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
||||
import AuthenticationService from 'services/Authentication';
|
||||
import { IUserOTD, ISystemUser, IRegisterOTD } from 'interfaces';
|
||||
import { ILoginDTO, ISystemUser, IRegisterOTD } from 'interfaces';
|
||||
import { ServiceError, ServiceErrors } from "exceptions";
|
||||
|
||||
@Service()
|
||||
@@ -61,7 +60,6 @@ export default class AuthenticationController extends BaseController{
|
||||
*/
|
||||
get registerSchema(): ValidationChain[] {
|
||||
return [
|
||||
check('organization_name').exists().trim().escape(),
|
||||
check('first_name').exists().trim().escape(),
|
||||
check('last_name').exists().trim().escape(),
|
||||
check('email').exists().isEmail().trim().escape(),
|
||||
@@ -102,7 +100,7 @@ export default class AuthenticationController extends BaseController{
|
||||
* @param {Response} res
|
||||
*/
|
||||
async login(req: Request, res: Response, next: Function): Response {
|
||||
const userDTO: IUserOTD = this.matchedBodyData(req);
|
||||
const userDTO: ILoginDTO = this.matchedBodyData(req);
|
||||
|
||||
try {
|
||||
const { token, user, tenant } = await this.authService.signIn(
|
||||
|
||||
@@ -9,6 +9,11 @@ export interface IRegisterDTO {
|
||||
organizationName: string,
|
||||
};
|
||||
|
||||
export interface ILoginDTO {
|
||||
crediential: string,
|
||||
password: string,
|
||||
};
|
||||
|
||||
export interface IPasswordReset {
|
||||
id: number,
|
||||
email: string,
|
||||
|
||||
@@ -135,7 +135,7 @@ export default class AuthenticationService implements IAuthenticationService {
|
||||
|
||||
const { systemUserRepository } = this.sysRepositories;
|
||||
const registeredUser = await systemUserRepository.create({
|
||||
...omit(registerDTO, 'country', 'organizationName'),
|
||||
...omit(registerDTO, 'country'),
|
||||
active: true,
|
||||
password: hashedPassword,
|
||||
tenant_id: tenant.id,
|
||||
|
||||
Reference in New Issue
Block a user