mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	Add Domain Verification on Onboarding Wizard
This commit is contained in:
		| @ -1,4 +1,4 @@ | ||||
| import i18n from '../plugins/i18n'; | ||||
| import i18n from '../plugins/i18n' | ||||
|  | ||||
| export default { | ||||
|   addClass(el, className) { | ||||
| @ -51,9 +51,9 @@ export default { | ||||
|         .replace(/(\d{3})(?=\d)/g, '$1' + thousand_separator) | ||||
|       let precisionText = precision | ||||
|         ? decimal_separator + | ||||
|           Math.abs(amount - i) | ||||
|             .toFixed(precision) | ||||
|             .slice(2) | ||||
|         Math.abs(amount - i) | ||||
|           .toFixed(precision) | ||||
|           .slice(2) | ||||
|         : '' | ||||
|       let combinedAmountText = | ||||
|         negativeSign + thousandText + amountText + precisionText | ||||
| @ -104,9 +104,9 @@ export default { | ||||
|         .replace(/(\d{3})(?=\d)/g, '$1' + thousand_separator) | ||||
|       let precisionText = precision | ||||
|         ? decimal_separator + | ||||
|           Math.abs(amount - i) | ||||
|             .toFixed(precision) | ||||
|             .slice(2) | ||||
|         Math.abs(amount - i) | ||||
|           .toFixed(precision) | ||||
|           .slice(2) | ||||
|         : '' | ||||
|       let combinedAmountText = | ||||
|         negativeSign + thousandText + amountText + precisionText | ||||
| @ -130,11 +130,11 @@ export default { | ||||
|     } | ||||
|     let pattern = new RegExp( | ||||
|       '^(https?:\\/\\/)?' + // protocol | ||||
|         '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name | ||||
|         '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address | ||||
|         '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path | ||||
|         '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string | ||||
|         '(\\#[-a-z\\d_]*)?$', | ||||
|       '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name | ||||
|       '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address | ||||
|       '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path | ||||
|       '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string | ||||
|       '(\\#[-a-z\\d_]*)?$', | ||||
|       'i' | ||||
|     ) // fragment locator | ||||
|  | ||||
| @ -142,12 +142,20 @@ export default { | ||||
|   }, | ||||
|  | ||||
|   checkValidDomainUrl(url) { | ||||
|     if (url.includes('localhost')) { | ||||
|     if (url.includes('localhost') || url.includes('127.0.0.1')) { | ||||
|       return true | ||||
|     } | ||||
|  | ||||
|     let pattern = new RegExp( | ||||
|       '^([0-9A-Za-z-\\.@:%_+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?' | ||||
|     ) | ||||
|       '^(https?:\\/\\/)?' + // protocol | ||||
|       '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name | ||||
|       '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address | ||||
|       '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path | ||||
|       '(\\?[;&a-z\\d%_.~+=-]*)?' + // query string | ||||
|       '(\\#[-a-z\\d_]*)?$', | ||||
|       'i' | ||||
|     ) // fragment locator | ||||
|  | ||||
|     return !!pattern.test(url) | ||||
|   }, | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user