FlowAuth creates duplicate new tokens
Describe the bug Creating a token in FlowAuth requires clicking "save" twice, and then two tokens are created.
Product FlowAuth v1.11.1+56.g91910409
To Reproduce Steps to reproduce the behavior:
- Log into FlowAuth
- Select the server
- Click '+' to add a new token
- Give it a name
- Click 'save' - nothing happens
- Click 'save' again - get taken back to the list of tokens, where the new token has appeared
- Click 'copy' next to the new token - the 'add token' view reappears
- Click 'cancel' - get taken back to the list of tokens
- There are now 2 new tokens, with the same name and expiry, but by 'view'ing the tokens we can see they are different.
Expected behavior Should be able to create just one new token, and then copy it.
Additional context I was logged in as an admin user - not sure if that has any relevance.
I think actually the problem here is that it's being a bit slow to generate the token, and I was being impatient.
So two things that could perhaps be handled better:
- If "save" is clicked a second time before it's finished responding to the first, don't create a second token
- Don't re-open the "create token" view after it's closed, unless the user clicks the '+' button again
but no serious issues here.
I can't reproduce this. Both as admin and regular user I get taken back straight after the first click, even if I attempt to double click the button. Tested on current master. There are some other minor things such as checkboxes not visible when the browser window is small and a new server only appearing after refreshing the page but this here seems to work fine.
I can still reproduce this, but on a very slow server, and still on v1.14.6. So it may be that the issue is fixed in v1.15.0, or maybe it's only a problem on a slow server (generating a token takes a few seconds).
Tokens aren't unique on token name, they get a serial ID, so I'd expect this to still happen given fast enough clicking and a slow enough server esp if there's more than one backend running.