Skip to content

Commit

Permalink
OV-5: * add tokenservice to services and update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-lacorazza committed Aug 20, 2024
1 parent f62acc2 commit add55d7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions backend/src/bundles/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions backend/src/bundles/users/user.service.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 3 additions & 1 deletion backend/src/common/services/services.ts
Original file line number Diff line number Diff line change
@@ -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 };
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,4 @@ public async verifyToken(token: string): Promise<TokenPayload | null> {
}
}

const tokenService = new TokenService('your_secret_key', '24h');

export { tokenService };
export { TokenService };

0 comments on commit add55d7

Please sign in to comment.