Skip to content

Commit a99657e

Browse files
committed
[IDLE-451] 3개이상 연속된 문자 검증 로직 수정
3번이 아니라 3번 이상으로 변경 -> 문자열이 3번이상 같은 문자열 연속을 포함 으로 변경
1 parent 60ce070 commit a99657e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

project/Projects/Domain/Sources/ConcreteUseCase/Auth/DefaultAuthInputValidationUseCase.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public class DefaultAuthInputValidationUseCase: AuthInputValidationUseCase {
8282
let noWhitespaceIsValid = evaluateStringWith(regex: noWhitespaceRegex, targetString: password)
8383

8484
// 4. 연속된 문자 3개 이상 사용 금지
85-
let noTripleRepeatedCharsRegex = "(.)\\1{2,}"
86-
let noTripleRepeatedCharsIsValid = !evaluateStringWith(regex: noTripleRepeatedCharsRegex, targetString: password)
85+
let noTripleRepeatedCharsRegex = "^(?!.*(.)\\1{2,}).*$"
86+
let noTripleRepeatedCharsIsValid = evaluateStringWith(regex: noTripleRepeatedCharsRegex, targetString: password)
8787

8888
return PasswordValidationState(
8989
characterCount: lengthIsValid ? .valid : .invalid,

0 commit comments

Comments
 (0)