When e.detail.success was false, it means failed to verify the user.
In that case, you can't get token. so you have to reload the page, or use nonstress.generateToken() .
You can get the token directly even the Event is already dispatched:
It's pretty simple. in this case, it returns empty string when nonstress isn't completed or it's failed.
Regenerate The Token
Oh, user typo the password, cancelled action, or nonstress failed? if token is once validated, it can't be reused, but you don't have to reload the page.
Here's magic:
It will regenerate the token, redispatch the Event and overwrite nonstress.getToken() .