Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
fix: server cleanup (#136)
Browse files Browse the repository at this point in the history
* feat: new filters approach

* fix: old issues

* feat: new jwt approach to hash

* fix: small issues on frontend

* fix: lint errors
  • Loading branch information
nmashchenko committed Dec 3, 2023
1 parent 569aec6 commit b6ef6db
Show file tree
Hide file tree
Showing 33 changed files with 499 additions and 350 deletions.
6 changes: 4 additions & 2 deletions client/src/app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function SignupPage() {
const [password, setPassword] = useState('');
const [repeatPassword, setRepeatPassword] = useState('');
const router = useRouter();
const { mutate: registerUser } = useRegister();
const { mutate: registerUser, isPending } = useRegister();

const login = useGoogleLogin({
onSuccess: codeResponse => router.push(`/proxy/google?code=${codeResponse.code}`),
Expand Down Expand Up @@ -76,7 +76,9 @@ export default function SignupPage() {
</Flex>

<Flex direction='column' gap={24}>
<Button type='submit'>Sign up</Button>
<Button type='submit' loading={isPending}>
Sign up
</Button>

<Flex justify='center' align='center' gap={13} className={styles.lines_container}>
<div className={styles.line} />
Expand Down
13 changes: 5 additions & 8 deletions client/src/entities/session/api/useConfirmEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ import { useMutation } from '@tanstack/react-query';
import { API } from '@/shared/api';
import { IConfirmEmail, ILoginResponse } from '@teameights/types';
import { toast } from 'sonner';
import { API_EMAIL_CONFIRM, DEFAULT, ONBOARDING } from '@/shared/constant';
import { API_EMAIL_CONFIRM, DEFAULT, LOGIN } from '@/shared/constant';
import { useRouter } from 'next/navigation';
import Cookies from 'js-cookie';

export const useConfirmEmail = () => {
const router = useRouter();
return useMutation({
mutationFn: async (data: IConfirmEmail) =>
await API.post<ILoginResponse>(API_EMAIL_CONFIRM, data),
onSuccess: data => {
localStorage.setItem('token', data.data.token);
Cookies.set('refreshToken', data.data.refreshToken);

router.push(ONBOARDING);
onSuccess: () => {
toast.success('Successful confirmation! Log into your account.');
router.push(LOGIN);
},
onError: () => {
router.push(DEFAULT);
toast.error('Invalid email confirmation');
router.push(DEFAULT);
},
});
};
2 changes: 2 additions & 0 deletions client/src/shared/constant/client-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ export const PASSWORD_SUCCESS = '/password/success';
export const PASSWORD_EXPIRED = '/password/expired';

export const SIGNUP_CONFIRMATION = '/signup/confirmation';

export const LOGIN = '/login';
1 change: 1 addition & 0 deletions server/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.9.0
99 changes: 99 additions & 0 deletions server/docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ We use [TypeORM](https://www.npmjs.com/package/typeorm) and [PostgreSQL](https:/
- [Seeding](#seeding)
- [Creating seeds](#creating-seeds)
- [Run seed](#run-seed)
- [Factory and Faker](#factory-and-faker)
- [Performance optimization](#performance-optimization)
- [Indexes and Foreign Keys](#indexes-and-foreign-keys)
- [Max connections](#max-connections)
Expand Down Expand Up @@ -92,6 +93,104 @@ yarn seed:run

---

### Factory and Faker

1. Install faker:

```bash
yarn add --save-dev @faker-js/faker
```
1. Create `src/libs/database/seeds/user/user.factory.ts`:
```ts
import { faker } from '@faker-js/faker';
import { RoleEnum } from 'src/roles/roles.enum';
import { StatusEnum } from 'src/statuses/statuses.enum';
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Role } from 'src/roles/entities/role.entity';
import { Status } from 'src/statuses/entities/status.entity';
import { User } from 'src/users/entities/user.entity';

@Injectable()
export class UserFactory {
constructor(
@InjectRepository(User)
private repositoryUser: Repository<User>,
@InjectRepository(Role)
private repositoryRole: Repository<Role>,
@InjectRepository(Status)
private repositoryStatus: Repository<Status>,
) {}

createRandomUser() {
// Need for saving "this" context
return () => {
return this.repositoryUser.create({
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
password: faker.internet.password(),
role: this.repositoryRole.create({
id: RoleEnum.user,
name: 'User',
}),
status: this.repositoryStatus.create({
id: StatusEnum.active,
name: 'Active',
}),
});
};
}
}
```
1. Make changes in `src/libs/database/seeds/user/user-seed.service.ts`:
```ts
// Some code here...
import { UserFactory } from './user.factory';
import { faker } from '@faker-js/faker';

@Injectable()
export class UserSeedService {
constructor(
// Some code here...
private userFactory: UserFactory,
) {}

async run() {
// Some code here...

await this.repository.save(
faker.helpers.multiple(this.userFactory.createRandomUser(), {
count: 5,
}),
);
}
}
```
1. Make changes in `src/libs/database/seeds/user/user-seed.module.ts`:
```ts
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from 'src/users/entities/user.entity';
import { UserSeedService } from './user-seed.service';
import { UserFactory } from './user.factory';
import { Role } from 'src/roles/entities/role.entity';
import { Status } from 'src/statuses/entities/status.entity';

@Module({
imports: [TypeOrmModule.forFeature([User, Role, Status])],
providers: [UserSeedService, UserFactory],
exports: [UserSeedService, UserFactory],
})
export class UserSeedModule {}

```
1. Run seed:
```bash
npm run seed:run
```

## Performance optimization

### Indexes and Foreign Keys
Expand Down
3 changes: 1 addition & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"passport-anonymous": "1.0.1",
"passport-jwt": "4.0.1",
"pg": "8.11.3",
"qs": "^6.11.2",
"reflect-metadata": "0.1.13",
"rimraf": "5.0.1",
"rxjs": "7.8.1",
Expand Down Expand Up @@ -96,7 +95,7 @@
"hygen": "6.2.11",
"is-ci": "3.0.1",
"jest": "29.7.0",
"prettier": "3.0.3",
"prettier": "^3.1.0",
"supertest": "6.3.3",
"ts-jest": "29.1.1",
"ts-loader": "9.4.4",
Expand Down
2 changes: 0 additions & 2 deletions server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { AuthGoogleModule } from './modules/auth/auth-google/auth-google.module'
import { I18nModule } from 'nestjs-i18n/dist/i18n.module';
import { HeaderResolver } from 'nestjs-i18n';
import { TypeOrmConfigService } from './libs/database/typeorm-config.service';
import { ForgotModule } from './modules/forgot/forgot.module';
import { MailModule } from './modules/mail/mail.module';
import { HomeModule } from './modules/home/home.module';
import { DataSource, DataSourceOptions } from 'typeorm';
Expand Down Expand Up @@ -73,7 +72,6 @@ import githubConfig from './config/github.config';
FilesModule,
AuthModule,
AuthGoogleModule,
ForgotModule,
SessionModule,
MailModule,
MailerModule,
Expand Down
4 changes: 2 additions & 2 deletions server/src/config/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default registerAs<AppConfig>('app', () => {
port: process.env.APP_PORT
? parseInt(process.env.APP_PORT, 10)
: process.env.PORT
? parseInt(process.env.PORT, 10)
: 3001,
? parseInt(process.env.PORT, 10)
: 3001,
apiPrefix: process.env.API_PREFIX || 'api',
fallbackLanguage: process.env.APP_FALLBACK_LANGUAGE || 'en',
headerLanguage: process.env.APP_HEADER_LANGUAGE || 'x-custom-lang',
Expand Down
16 changes: 16 additions & 0 deletions server/src/config/auth.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ class EnvironmentVariablesValidator {

@IsString()
AUTH_REFRESH_TOKEN_EXPIRES_IN: string;

@IsString()
AUTH_FORGOT_SECRET: string;

@IsString()
AUTH_FORGOT_TOKEN_EXPIRES_IN: string;

@IsString()
AUTH_CONFIRM_EMAIL_SECRET: string;

@IsString()
AUTH_CONFIRM_EMAIL_TOKEN_EXPIRES_IN: string;
}

export default registerAs<AuthConfig>('auth', () => {
Expand All @@ -25,5 +37,9 @@ export default registerAs<AuthConfig>('auth', () => {
expires: process.env.AUTH_JWT_TOKEN_EXPIRES_IN,
refreshSecret: process.env.AUTH_REFRESH_SECRET,
refreshExpires: process.env.AUTH_REFRESH_TOKEN_EXPIRES_IN,
forgotSecret: process.env.AUTH_FORGOT_SECRET,
forgotExpires: process.env.AUTH_FORGOT_TOKEN_EXPIRES_IN,
confirmEmailSecret: process.env.AUTH_CONFIRM_EMAIL_SECRET,
confirmEmailExpires: process.env.AUTH_CONFIRM_EMAIL_TOKEN_EXPIRES_IN,
};
});
4 changes: 4 additions & 0 deletions server/src/config/config.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export type AuthConfig = {
expires?: string;
refreshSecret?: string;
refreshExpires?: string;
forgotSecret?: string;
forgotExpires?: string;
confirmEmailSecret?: string;
confirmEmailExpires?: string;
};

export type DatabaseConfig = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,64 +1,56 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class CreateUser1701284493876 implements MigrationInterface {
name = 'CreateUser1701284493876'
export class CreateUser1701598001777 implements MigrationInterface {
name = 'CreateUser1701598001777'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "role" ("id" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_b36bcfe02fc8de3c57a8b2391c2" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "status" ("id" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_e12743a7086ec826733f54e1d95" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "file" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "path" character varying NOT NULL, CONSTRAINT "PK_36b46d232307066b3a2c9ea3a1d" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "universities" ("id" SERIAL NOT NULL, "university" character varying NOT NULL, "degree" character varying NOT NULL, "major" character varying NOT NULL, "admissionDate" date NOT NULL, "graduationDate" date, "userId" integer, CONSTRAINT "PK_8da52f2cee6b407559fdbabf59e" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "jobs" ("id" SERIAL NOT NULL, "title" character varying NOT NULL, "company" character varying NOT NULL, "startDate" date NOT NULL, "endDate" date, "userId" integer, CONSTRAINT "PK_cf0a6c42b72fcc7f7c237def345" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "projects" ("id" SERIAL NOT NULL, "title" character varying NOT NULL, "link" character varying NOT NULL, "userId" integer, CONSTRAINT "PK_6271df0a7aed1d6c0691ce6ac50" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "links" ("id" SERIAL NOT NULL, "github" character varying, "linkedIn" character varying, "behance" character varying, "telegram" character varying, CONSTRAINT "PK_ecf17f4a741d3c5ba0b4c5ab4b6" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "skills" ("id" SERIAL NOT NULL, "designerTools" text array, "projectManagerTools" text array, "fields" text array, "programmingLanguages" text array, "frameworks" text array, "methodologies" text array, CONSTRAINT "PK_0d3212120f4ecedf90864d7e298" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "user" ("id" SERIAL NOT NULL, "email" character varying, "password" character varying, "username" character varying, "provider" character varying NOT NULL DEFAULT 'email', "socialId" character varying, "fullName" character varying, "hash" character varying, "isLeader" boolean, "country" character varying, "dateOfBirth" date, "speciality" character varying, "description" character varying, "experience" character varying, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "photoId" uuid, "roleId" integer, "statusId" integer, "skillsId" integer, "linksId" integer, CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), CONSTRAINT "UQ_78a916df40e02a9deb1c4b75edb" UNIQUE ("username"), CONSTRAINT "REL_0e51e612eb9ed2fa5ac4f44c7e" UNIQUE ("skillsId"), CONSTRAINT "REL_c5a79824fd8a241f5a7ec428b3" UNIQUE ("linksId"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "user" ("id" SERIAL NOT NULL, "email" character varying, "password" character varying, "username" character varying, "provider" character varying NOT NULL DEFAULT 'email', "socialId" character varying, "fullName" character varying, "isLeader" boolean, "country" character varying, "dateOfBirth" date, "speciality" character varying, "description" character varying, "experience" character varying, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "photoId" uuid, "roleId" integer, "statusId" integer, "skillsId" integer, "linksId" integer, CONSTRAINT "UQ_e12875dfb3b1d92d7d7c5377e22" UNIQUE ("email"), CONSTRAINT "UQ_78a916df40e02a9deb1c4b75edb" UNIQUE ("username"), CONSTRAINT "REL_0e51e612eb9ed2fa5ac4f44c7e" UNIQUE ("skillsId"), CONSTRAINT "REL_c5a79824fd8a241f5a7ec428b3" UNIQUE ("linksId"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE INDEX "IDX_9bd2fe7a8e694dedc4ec2f666f" ON "user" ("socialId") `);
await queryRunner.query(`CREATE INDEX "IDX_035190f70c9aff0ef331258d28" ON "user" ("fullName") `);
await queryRunner.query(`CREATE INDEX "IDX_e282acb94d2e3aec10f480e4f6" ON "user" ("hash") `);
await queryRunner.query(`CREATE INDEX "IDX_8bceb9ec5c48c54f7a3f11f31b" ON "user" ("isLeader") `);
await queryRunner.query(`CREATE INDEX "IDX_5cb2b3e0419a73a360d327d497" ON "user" ("country") `);
await queryRunner.query(`CREATE TABLE "jobs" ("id" SERIAL NOT NULL, "title" character varying NOT NULL, "company" character varying NOT NULL, "startDate" date NOT NULL, "endDate" date, "userId" integer, CONSTRAINT "PK_cf0a6c42b72fcc7f7c237def345" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE TABLE "session" ("id" SERIAL NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "userId" integer, CONSTRAINT "PK_f55da76ac1c3ac420f444d2ff11" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE INDEX "IDX_3d2f174ef04fb312fdebd0ddc5" ON "session" ("userId") `);
await queryRunner.query(`CREATE TABLE "forgot" ("id" SERIAL NOT NULL, "hash" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "userId" integer, CONSTRAINT "PK_087959f5bb89da4ce3d763eab75" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE INDEX "IDX_df507d27b0fb20cd5f7bef9b9a" ON "forgot" ("hash") `);
await queryRunner.query(`ALTER TABLE "universities" ADD CONSTRAINT "FK_a8ad75b47a153c0d91f8360c9fb" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "jobs" ADD CONSTRAINT "FK_79ae682707059d5f7655db4212a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "projects" ADD CONSTRAINT "FK_361a53ae58ef7034adc3c06f09f" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_75e2be4ce11d447ef43be0e374f" FOREIGN KEY ("photoId") REFERENCES "file"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_c28e52f758e7bbc53828db92194" FOREIGN KEY ("roleId") REFERENCES "role"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_dc18daa696860586ba4667a9d31" FOREIGN KEY ("statusId") REFERENCES "status"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_0e51e612eb9ed2fa5ac4f44c7e1" FOREIGN KEY ("skillsId") REFERENCES "skills"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_c5a79824fd8a241f5a7ec428b3e" FOREIGN KEY ("linksId") REFERENCES "links"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "jobs" ADD CONSTRAINT "FK_79ae682707059d5f7655db4212a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "session" ADD CONSTRAINT "FK_3d2f174ef04fb312fdebd0ddc53" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "forgot" ADD CONSTRAINT "FK_31f3c80de0525250f31e23a9b83" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "forgot" DROP CONSTRAINT "FK_31f3c80de0525250f31e23a9b83"`);
await queryRunner.query(`ALTER TABLE "session" DROP CONSTRAINT "FK_3d2f174ef04fb312fdebd0ddc53"`);
await queryRunner.query(`ALTER TABLE "jobs" DROP CONSTRAINT "FK_79ae682707059d5f7655db4212a"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_c5a79824fd8a241f5a7ec428b3e"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_0e51e612eb9ed2fa5ac4f44c7e1"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_dc18daa696860586ba4667a9d31"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_c28e52f758e7bbc53828db92194"`);
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_75e2be4ce11d447ef43be0e374f"`);
await queryRunner.query(`ALTER TABLE "projects" DROP CONSTRAINT "FK_361a53ae58ef7034adc3c06f09f"`);
await queryRunner.query(`ALTER TABLE "jobs" DROP CONSTRAINT "FK_79ae682707059d5f7655db4212a"`);
await queryRunner.query(`ALTER TABLE "universities" DROP CONSTRAINT "FK_a8ad75b47a153c0d91f8360c9fb"`);
await queryRunner.query(`DROP INDEX "public"."IDX_df507d27b0fb20cd5f7bef9b9a"`);
await queryRunner.query(`DROP TABLE "forgot"`);
await queryRunner.query(`DROP INDEX "public"."IDX_3d2f174ef04fb312fdebd0ddc5"`);
await queryRunner.query(`DROP TABLE "session"`);
await queryRunner.query(`DROP TABLE "jobs"`);
await queryRunner.query(`DROP INDEX "public"."IDX_5cb2b3e0419a73a360d327d497"`);
await queryRunner.query(`DROP INDEX "public"."IDX_8bceb9ec5c48c54f7a3f11f31b"`);
await queryRunner.query(`DROP INDEX "public"."IDX_e282acb94d2e3aec10f480e4f6"`);
await queryRunner.query(`DROP INDEX "public"."IDX_035190f70c9aff0ef331258d28"`);
await queryRunner.query(`DROP INDEX "public"."IDX_9bd2fe7a8e694dedc4ec2f666f"`);
await queryRunner.query(`DROP TABLE "user"`);
await queryRunner.query(`DROP TABLE "skills"`);
await queryRunner.query(`DROP TABLE "links"`);
await queryRunner.query(`DROP TABLE "projects"`);
await queryRunner.query(`DROP TABLE "jobs"`);
await queryRunner.query(`DROP TABLE "universities"`);
await queryRunner.query(`DROP TABLE "file"`);
await queryRunner.query(`DROP TABLE "status"`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
import { Body, Controller, HttpCode, HttpStatus, Post, SerializeOptions } from '@nestjs/common';
import { AuthService } from 'src/modules/auth/base/auth.service';
import { LoginResponseType } from 'src/modules/auth/base/types/login-response.type';
import { AuthGithubService } from './auth-github.service';
Expand All @@ -16,6 +16,9 @@ export class AuthGithubController {
private readonly authGithubService: AuthGithubService
) {}

@SerializeOptions({
groups: ['me'],
})
@Post('login')
@HttpCode(HttpStatus.OK)
async login(@Body() loginDto: AuthGithubLoginDto): Promise<LoginResponseType> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
import { Body, Controller, HttpCode, HttpStatus, Post, SerializeOptions } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AuthService } from 'src/modules/auth/base/auth.service';
import { AuthGoogleService } from './auth-google.service';
Expand All @@ -16,6 +16,9 @@ export class AuthGoogleController {
private readonly authGoogleService: AuthGoogleService
) {}

@SerializeOptions({
groups: ['me'],
})
@Post('login')
@HttpCode(HttpStatus.OK)
async login(@Body() loginDto: AuthGoogleLoginDto): Promise<LoginResponseType> {
Expand Down
Loading

2 comments on commit b6ef6db

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for teameights ready!

✅ Preview
https://teameights-fx2rcuuum-exortme1ster.vercel.app

Built with commit b6ef6db.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for teameights-storybook ready!

✅ Preview
https://teameights-storybook-ig38d7hd1-exortme1ster.vercel.app

Built with commit b6ef6db.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.