aleph-im / aleph-account

Aleph.im's Account management dApp
https://account.aleph.im/
2 stars 3 forks source link

Add format validation on CCN multiaddr and CRN URL. #27

Closed leirbag95 closed 2 years ago

leirbag95 commented 2 years ago

Fixed of the following issue : https://github.com/aleph-im/aleph-account/issues/26

I added the following regex rule:

rules: {
        url: (value) => {
          const pattern = /^(ftp|http|https):\/\/[^ "]+$/
          return pattern.test(value) || 'Please enter a valid address.'
        }
      }

It allows to check that the provided format is a real address