FlowKit icon indicating copy to clipboard operation
FlowKit copied to clipboard

FlowAuth creates duplicate new tokens

Open jc-harrison opened this issue 5 years ago • 4 comments

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:

  1. Log into FlowAuth
  2. Select the server
  3. Click '+' to add a new token
  4. Give it a name
  5. Click 'save' - nothing happens
  6. Click 'save' again - get taken back to the list of tokens, where the new token has appeared
  7. Click 'copy' next to the new token - the 'add token' view reappears
  8. Click 'cancel' - get taken back to the list of tokens
  9. 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.

jc-harrison avatar Jul 03 '20 10:07 jc-harrison

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.

jc-harrison avatar Jul 03 '20 14:07 jc-harrison

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.

flowstef avatar Oct 19 '21 09:10 flowstef

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).

jc-harrison avatar Oct 19 '21 10:10 jc-harrison

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.

greenape avatar Oct 19 '21 10:10 greenape