Skip to content

Commit 31eddc1

Browse files
committed
refactor: auth service
1 parent 737f6d6 commit 31eddc1

17 files changed

Lines changed: 284 additions & 258 deletions

File tree

packages/apps/human-app/frontend/src/modules/auth-web3/context/web3-auth-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { type AuthTokensSuccessResponse } from '@/shared/schemas';
1212

1313
const web3userDataSchema = z.object({
14-
userId: z.number(),
14+
user_id: z.number(),
1515
wallet_address: z.string(),
1616
reputation_network: z.string(),
1717
exp: z.number(),

packages/apps/human-app/frontend/src/modules/auth/context/auth-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const extendableUserDataSchema = z.object({
2020
const userDataSchema = z
2121
.object({
2222
email: z.string(),
23-
userId: z.number(),
23+
user_id: z.number(),
2424
reputation_network: z.string(),
2525
email_notifications: z.boolean().optional(), // TODO that should be verified when email notifications feature is done
2626
exp: z.number(),

packages/apps/human-app/server/src/common/utils/jwt-token.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AutoMap } from '@automapper/classes';
22

33
export class JwtUserData {
44
@AutoMap()
5-
userId: string;
5+
user_id: string;
66
@AutoMap()
77
wallet_address: string;
88
@AutoMap()

packages/apps/human-app/server/src/modules/h-captcha/spec/h-captcha.fixtures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const EARNINGS_DATA_2 = {
7070
};
7171
const SUCCESSFULLY_ENABLED = 'Enabled labeling for this account successfully';
7272
export const jwtUserDataFixture: JwtUserData = {
73-
userId: ID,
73+
user_id: ID,
7474
wallet_address: POLYGON_WALLET_ADDR,
7575
email: EMAIL,
7676
kyc_status: 'approved',

packages/apps/reputation-oracle/server/src/modules/auth/auth.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ export class AuthController {
150150
@Post('/web2/resend-verification-email')
151151
@HttpCode(200)
152152
async resendEmailVerification(
153+
@Req() request: RequestWithUser,
153154
@Body() data: ResendVerificationEmailDto,
154155
): Promise<void> {
155-
await this.authService.resendEmailVerification(data);
156+
await this.authService.resendEmailVerification(request.user, data);
156157
}
157158

158159
@ApiOperation({

packages/apps/reputation-oracle/server/src/modules/auth/auth.error.filter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import {
66
} from '@nestjs/common';
77
import { Request, Response } from 'express';
88

9+
import logger from '../../logger';
10+
911
import {
1012
AuthError,
1113
DuplicatedUserAddressError,
1214
DuplicatedUserEmailError,
1315
InvalidOperatorSignupDataError,
1416
} from './auth.error';
1517

16-
import logger from '../../logger';
17-
1818
type AuthControllerError =
1919
| AuthError
2020
| DuplicatedUserEmailError

packages/apps/reputation-oracle/server/src/modules/auth/auth.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { EmailModule } from '../email/module';
77
import { UserModule } from '../user';
88
import { Web3Module } from '../web3/web3.module';
99

10-
import { JwtHttpStrategy } from './jwt-http-strategy';
11-
import { AuthService } from './auth.service';
1210
import { AuthController } from './auth.controller';
11+
import { AuthService } from './auth.service';
12+
import { JwtHttpStrategy } from './jwt-http-strategy';
1313
import { TokenRepository } from './token.repository';
1414

1515
@Module({

0 commit comments

Comments
 (0)