diff --git a/backend/src/bundles/auth/auth.service.ts b/backend/src/bundles/auth/auth.service.ts index 2a4917b3b..21951a589 100644 --- a/backend/src/bundles/auth/auth.service.ts +++ b/backend/src/bundles/auth/auth.service.ts @@ -8,9 +8,8 @@ import { type UserSignInResponseDto, } from '~/bundles/users/users.js'; import { HttpCode, HttpError } from '~/common/http/http.js'; -import { cryptService } from '~/common/services/services.js'; +import { cryptService, tokenService } from '~/common/services/services.js'; -import { tokenService } from '../../common/services/token/token-services.js'; import { UserValidationMessage } from './enums/enums.js'; class AuthService { diff --git a/backend/src/bundles/users/user.service.ts b/backend/src/bundles/users/user.service.ts index 71e83e415..d8d05b67a 100644 --- a/backend/src/bundles/users/user.service.ts +++ b/backend/src/bundles/users/user.service.ts @@ -1,9 +1,8 @@ import { type UserRepository } from '~/bundles/users/user.repository.js'; -import { cryptService } from '~/common/services/services.js'; +import { cryptService, tokenService } from '~/common/services/services.js'; import { type Service } from '~/common/types/types.js'; import { UserEntity } from '../../bundles/users/user.entity.js'; -import { tokenService } from '../../common/services/token/token-services.js'; import { type UserGetAllResponseDto, type UserSignUpRequestDto, diff --git a/backend/src/common/services/services.ts b/backend/src/common/services/services.ts index 2be4c1278..67df23808 100644 --- a/backend/src/common/services/services.ts +++ b/backend/src/common/services/services.ts @@ -1,5 +1,7 @@ import { CryptService } from './crypt/crypt.service.js'; +import { TokenService } from './token/token.services.js'; const cryptService = new CryptService(); +const tokenService = new TokenService('your_secret_key', '24h'); -export { cryptService }; +export { cryptService, tokenService }; diff --git a/backend/src/common/services/token/token-services.ts b/backend/src/common/services/token/token.services.ts similarity index 90% rename from backend/src/common/services/token/token-services.ts rename to backend/src/common/services/token/token.services.ts index 021b39380..408bc05aa 100644 --- a/backend/src/common/services/token/token-services.ts +++ b/backend/src/common/services/token/token.services.ts @@ -27,6 +27,4 @@ public async verifyToken(token: string): Promise { } } -const tokenService = new TokenService('your_secret_key', '24h'); - -export { tokenService }; \ No newline at end of file +export { TokenService }; \ No newline at end of file