meven_auth_app_vuex icon indicating copy to clipboard operation
meven_auth_app_vuex copied to clipboard

Fix API execution flow

Open felipeplets opened this issue 5 years ago • 1 comments

The current registration API method flow has an issue in which any of the 3 methods that are fired using promises will race and the first one to return no matter which returns the user first. The result will be an error if the user is trying to register an already existent user, possibly failing on the save method before the ones that check if user or email exists return.

This PR code fix that making it always be executed in the right order.

The current code use my own environment settings, you can fix with your own and I recommend you to commit an .editorconfig, .prettierrc ou .eslintrc according to your rules and tools.

Ps.: I don't recommend not using semi colons on JavaScript since they can lead to integration errors.

felipeplets avatar Jun 22 '19 21:06 felipeplets

This is correct and I came upon another issue which is if the request is malformed it crashes the entire server. I fixed it by ensuring the username, password, and email exists.

chriswinter90 avatar Sep 14 '19 03:09 chriswinter90