Skip to content

Commit

Permalink
Validate SMTP username/email
Browse files Browse the repository at this point in the history
  • Loading branch information
samaradel committed Sep 19, 2024
1 parent f994a54 commit b7a7836
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/playground/src/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,9 @@ export async function isAvailableName(grid: GridClient, name: string) {

export function validateSmtp(v: string) {
const emailValidation = isEmail("Please provide a valid email address.")(v);
const username = isAlpha("Name must start with an alphabetical character.")(v[0]);
return emailValidation && username;
const username = !v.includes("@");
if (username) {
return username;
}
return emailValidation;
}

0 comments on commit b7a7836

Please sign in to comment.