When I enter the one-time code of "otpuser"

Type the one-time code of an account of the users registry on the server's code page and send it: the code its secret gives now (users.<handle>.otpSecret in cucumber.js, the base32 key an authenticator app is given), or the key of a code this scenario set up. A code is taken once: a second sign-in in the same 30-second window waits for the next window's code, as a person does.

            Then I should be back in the app

Examples

When I enter the one-time code of "otpuser"
When we enter the one-time code of "otpuser"
And I enter the one-time code of "otpuser"
When I enter the one-time code of "user"
When I enter the one-time code of "otpuser"

Pattern

When(/^(?:I|we) enter the one-time code of "([^"]*)"$/, …)

Part of @webship-js/keycloak-steps (github.com/webship/keycloak-steps), a step pack for Webship-js 2.0.x.