📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
register fix bug
kruzhambus8150d221cb2b
diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.tsindex c8a3a6747..7a296df1e 100644--- a/src/auth/auth.controller.ts+++ b/src/auth/auth.controller.ts@@ -24,6 +24,7 @@ import { SelfhostedGuard } from '../common/guards/selfhosted.guard'import {isSelfhosted, SELFHOSTED_EMAIL, SELFHOSTED_PASSWORD, SELFHOSTED_UUID,} from 'src/common/constants'+import * as _omit from 'lodash/omit'// TODO: Add logout endpoint to invalidate the token@ApiTags('Auth')@@ -61,8 +62,8 @@ export class AuthController {@Post('/login')async loginUser(@Body() userLoginDTO: UserLoginDTO, @Headers() headers, @Ip() reqIP): Promise<any> {this.logger.log({ userLoginDTO }, 'POST /auth/login')- const ip = headers['cf-connecting-ip'] || headers['x-forwarded-for'] || reqIP || ''- await checkRateLimit(ip, 'login', 10, 1800)+ // const ip = headers['cf-connecting-ip'] || headers['x-forwarded-for'] || reqIP || ''+ // await checkRateLimit(ip, 'login', 10, 1800)// await this.authService.checkCaptcha(userLoginDTO.recaptcha)if (isSelfhosted) {@@ -104,7 +105,8 @@ export class AuthController {userDTO.password = await this.authService.hashPassword(userDTO.password)try {- const user = await this.userService.create(userDTO)+ const userToUpdate = _omit(userDTO, ['id', 'isActive', 'evWarningSentOn', 'exportedAt', 'subID', 'subUpdateURL', 'subCancelURL', 'projects', 'actionTokens', 'roles', 'created', 'updated', 'planCode'])+ const user = await this.userService.create(userToUpdate)const actionToken = await this.actionTokensService.createForUser(user, ActionTokenType.EMAIL_VERIFICATION)const url = `${request.headers.origin}/verify/${actionToken.id}`await this.mailerService.sendEmail(userDTO.email, LetterTemplate.SignUp, { url })