vue.js – Force ‘update password’ popup using javascript

Problem:

I am trying to build a webapp with a password change feature that doesn’t use a form submit.
The flow is a bit like this:

  1. Bootstrap modal popup
  2. user enteres text
  3. On Modal ‘Ok’ a fetch is triggered that updates the database.
  4. On API confirm [somehow trigger the ‘update your password’ dialouge in firefox/chrome/etc.]

Tech stack:

In case it is relevant here is my tech-stack:

  • Vue.js ( No plugins or modules except VueX )
  • Bootstrap (with all the included js)

What i tried:

I am aware of the fact that i could use a hidden form pointed to a ‘dead’ endpoint that is submitted by Javascript.

Why i don’t like that solution:

  1. It feels like a hack
  2. I don’t want to create unecessary requests
  3. creating and destroying DOM-Elements for Javascript-only use is not ‘the clean way’ (as far as i know)
  4. This has to be a common thing, am i missing an API?

Thanks in advance!
– Stevetec

Product of the Month September 2016

Source link

Leave a Comment

Your email address will not be published. Required fields are marked *