fix(notif): loosen input validation on Pushover settings (#1166)

pull/1167/head
TheCatLady 4 years ago committed by GitHub
parent 36584eee85
commit 3148d31214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,13 +41,13 @@ const NotificationsPushover: React.FC = () => {
accessToken: Yup.string() accessToken: Yup.string()
.required(intl.formatMessage(messages.validationAccessTokenRequired)) .required(intl.formatMessage(messages.validationAccessTokenRequired))
.matches( .matches(
/^a[A-Za-z0-9]{29}$/, /^[a-z\d]{30}$/i,
intl.formatMessage(messages.validationAccessTokenRequired) intl.formatMessage(messages.validationAccessTokenRequired)
), ),
userToken: Yup.string() userToken: Yup.string()
.required(intl.formatMessage(messages.validationUserTokenRequired)) .required(intl.formatMessage(messages.validationUserTokenRequired))
.matches( .matches(
/^[ug][A-Za-z0-9]{29}$/, /^[a-z\d]{30}$/i,
intl.formatMessage(messages.validationUserTokenRequired) intl.formatMessage(messages.validationUserTokenRequired)
), ),
}); });

@ -18,7 +18,7 @@ const messages = defineMessages({
botAPI: 'Bot Authentication Token', botAPI: 'Bot Authentication Token',
chatId: 'Chat ID', chatId: 'Chat ID',
validationBotAPIRequired: 'You must provide a bot authentication token', validationBotAPIRequired: 'You must provide a bot authentication token',
validationChatIdRequired: 'You must provide a chat ID', validationChatIdRequired: 'You must provide a valid chat ID',
telegramsettingssaved: 'Telegram notification settings saved successfully!', telegramsettingssaved: 'Telegram notification settings saved successfully!',
telegramsettingsfailed: 'Telegram notification settings failed to save.', telegramsettingsfailed: 'Telegram notification settings failed to save.',
testsent: 'Test notification sent!', testsent: 'Test notification sent!',

@ -343,7 +343,7 @@
"components.Settings.Notifications.test": "Test", "components.Settings.Notifications.test": "Test",
"components.Settings.Notifications.testsent": "Test notification sent!", "components.Settings.Notifications.testsent": "Test notification sent!",
"components.Settings.Notifications.validationBotAPIRequired": "You must provide a bot authentication token", "components.Settings.Notifications.validationBotAPIRequired": "You must provide a bot authentication token",
"components.Settings.Notifications.validationChatIdRequired": "You must provide a chat ID", "components.Settings.Notifications.validationChatIdRequired": "You must provide a valid chat ID",
"components.Settings.Notifications.validationEmail": "You must provide a valid email address", "components.Settings.Notifications.validationEmail": "You must provide a valid email address",
"components.Settings.Notifications.validationSmtpHostRequired": "You must provide an SMTP host", "components.Settings.Notifications.validationSmtpHostRequired": "You must provide an SMTP host",
"components.Settings.Notifications.validationSmtpPortRequired": "You must provide an SMTP port", "components.Settings.Notifications.validationSmtpPortRequired": "You must provide an SMTP port",

Loading…
Cancel
Save