Merged PR 607: メールアドレス入力チェックの修正
## 概要 [Task3232: メールアドレス入力チェックの修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3232) - メールアドレス入力に対して規約に則ったチェックを実施するように修正しました。 - 画面での入力チェックとAPIのバリデーションを修正しています。 ## レビューポイント - クライアントのチェック内容は規約に則った内容になっているでしょうか? - 正規表現の構文として不自然な点はないでしょうか? - サーバー側のチェックをIsEmail+禁止文字の追加という形で対応していますが適切でしょうか? ## UIの変更 - なし ## 動作確認状況 - ローカルで確認
This commit is contained in:
parent
342baa9826
commit
a0da277c05
@ -8,8 +8,11 @@ export const selectInputValidationErrors = (state: RootState) => {
|
|||||||
const hasErrorEmptyAdminName = state.partner.apps.addPartner.adminName === "";
|
const hasErrorEmptyAdminName = state.partner.apps.addPartner.adminName === "";
|
||||||
const hasErrorEmptyEmail = state.partner.apps.addPartner.email === "";
|
const hasErrorEmptyEmail = state.partner.apps.addPartner.email === "";
|
||||||
|
|
||||||
|
const emailPattern =
|
||||||
|
/^[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]+@[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*\.[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*[a-zA-Z]$/;
|
||||||
|
|
||||||
const hasErrorIncorrectEmail =
|
const hasErrorIncorrectEmail =
|
||||||
(state.partner.apps.addPartner.email as string).match(/^[^@]+@[^@]+$/)
|
(state.partner.apps.addPartner.email as string).match(emailPattern)
|
||||||
?.length !== 1;
|
?.length !== 1;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -16,8 +16,10 @@ export const selectInputValidationErrors = (state: RootState) => {
|
|||||||
state.signup.apps.password
|
state.signup.apps.password
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const emailPattern =
|
||||||
|
/^[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]+@[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*\.[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*[a-zA-Z]$/;
|
||||||
const hasErrorIncorrectEmail =
|
const hasErrorIncorrectEmail =
|
||||||
(state.signup.apps.email as string).match(/^[^@]+@[^@]+$/)?.length !== 1;
|
(state.signup.apps.email as string).match(emailPattern)?.length !== 1;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hasErrorEmptyEmail,
|
hasErrorEmptyEmail,
|
||||||
|
|||||||
@ -26,7 +26,10 @@ export const selectInputValidationErrors = (state: RootState) => {
|
|||||||
role
|
role
|
||||||
);
|
);
|
||||||
|
|
||||||
const hasErrorIncorrectEmail = email.match(/^[^@]+@[^@]+$/)?.length !== 1;
|
const emailPattern =
|
||||||
|
/^[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]+@[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*\.[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*[a-zA-Z]$/;
|
||||||
|
|
||||||
|
const hasErrorIncorrectEmail = email.match(emailPattern)?.length !== 1;
|
||||||
|
|
||||||
const hasErrorIncorrectEncryptionPassword =
|
const hasErrorIncorrectEncryptionPassword =
|
||||||
checkErrorIncorrectEncryptionPassword(encryptionPassword, role, encryption);
|
checkErrorIncorrectEncryptionPassword(encryptionPassword, role, encryption);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ export class CreateAccountRequest {
|
|||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
adminName: string;
|
adminName: string;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsEmail()
|
@IsEmail({ blacklisted_chars: '*' })
|
||||||
adminMail: string;
|
adminMail: string;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsAdminPasswordvalid()
|
@IsAdminPasswordvalid()
|
||||||
@ -244,7 +244,7 @@ export class CreatePartnerAccountRequest {
|
|||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
adminName: string;
|
adminName: string;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@IsEmail()
|
@IsEmail({ blacklisted_chars: '*' })
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { IsIn } from 'class-validator';
|
import { IsEmail, IsIn } from 'class-validator';
|
||||||
import {
|
import {
|
||||||
TASK_LIST_SORTABLE_ATTRIBUTES,
|
TASK_LIST_SORTABLE_ATTRIBUTES,
|
||||||
USER_LICENSE_STATUS,
|
USER_LICENSE_STATUS,
|
||||||
@ -88,6 +88,7 @@ export class SignupRequest {
|
|||||||
authorId?: string;
|
authorId?: string;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
|
@IsEmail({ blacklisted_chars: '*' })
|
||||||
email: string;
|
email: string;
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user