commonLogin = options => {
  let { data, btn, url, redirect, defBtnValue } = options,
    overlay2 = new d('.overlay-2'),
    button = new d(btn),
    action = new Action(btn)

  action.start('Please wait..')

  post(url, data)
    .then(s => {
      let {
        data: { mssg, success },
      } = s

      if (success) {
        Notify({
          value: mssg,
          done: () => (location.href = redirect),
        })

        button.setValue('Redirecting..')
        overlay2.show()
      } else {
        Notify({
          value: ObjectMssg(mssg),
        })

        action.end(defBtnValue)
      }

      button.blur()
    })
    .catch(e => console.log(e))
}
Common function for login & signup

@param {Object} options Options
@param {Object} options.data
@param {String} options.btn
@param {String} options.url
@param {String} options.redirect
@param {String} options.defBtnValue