Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

사용하지 않는 코드 정리, import 순서 변경 #368

Merged
merged 5 commits into from
Dec 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: 리프레시 토큰 상수 사용
Conut-1 committed Dec 4, 2024
commit 0f8776904d3dc8a9c5ce810e52b1cd08b1ec10a0
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const REFRESH_TOKEN_EXPIRY_DAYS = 14;
export const REFRESH_TOKEN_EXPIRY_WEEKS = 2;
export const INVITE_CODE_LENGTH = 10;
export const INVITE_CODE_EXPIRY_HOURS = 6;
export const MAX_NAME_LENGTH = 20;
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import { Prisma, RefreshToken } from '@prisma/client';
import { v4 as uuid } from 'uuid';
import { PrismaService } from '../prisma/prisma.service';
import { getExpiryDate } from '../utils/date';
import { REFRESH_TOKEN_EXPIRY_WEEKS } from '../config/constants';

@Injectable()
export class RefreshTokensService {
@@ -19,7 +20,7 @@ export class RefreshTokensService {
return this.prisma.refreshToken.create({
data: {
token: this.createToken(),
expiryDate: getExpiryDate({ week: 2 }),
expiryDate: getExpiryDate({ week: REFRESH_TOKEN_EXPIRY_WEEKS }),
userUuid,
},
});