Skip to content

Commit 4d69ae7

Browse files
committed
Loosen validations
1 parent 4505e40 commit 4d69ae7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

TokenGenerator/Services/Token.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,17 @@ public bool TryParseScopes(string input, out string[] scopes)
386386

387387
public bool IsValidEmail(string identifier)
388388
{
389-
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, "^[a-z0-9_.+@-]+$");
389+
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, "^[^@]+@[^@]+$");
390390
}
391391

392392
public bool IsValidIdentifier(string identifier)
393393
{
394-
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, "^[a-z0-9_-]+$");
394+
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, "^[a-zA-Z0-9_-]+$");
395395
}
396396

397397
public bool IsValidDottedIdentifier(string identifier)
398398
{
399-
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, @"^(?:[a-z0-9_-]\.?)+[a-z0-9_-]$");
399+
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, @"^(?:[a-zA-Z0-9_-]\.?)+[a-zA-Z0-9_-]$");
400400
}
401401

402402
public bool IsValidOrgNo(string orgNo)

0 commit comments

Comments
 (0)