Sign in with an email code
An existing user enters their email, gets a one-time code, and signs in with the code.
Sub-features
completereaches the email code screen for an existing test user straight from Continue, stays on it, types424242, and lands signed in.
How to get to it (user POV)
- Open sign-in, type the email, tap Continue. On the standard instance a user with no password lands on the email code screen ("Check your email"). Type the code.
Driving it with verify
Preconditions:
The spec seeds a
+clerk_testuser on the standard instance and launches withauthMode: 'signIn', then tapse2e.auth.signInFullScreen.Request code. Run
e2e-tests/bin/control-clerk-android run sign-in-email-code/complete. It fillsclerk.auth.start.identifier, tapsclerk.auth.start.continue, expectsclerk.auth.signIn.code, and expects it still on screen 3 seconds later, with the email on the code screen. Screenshotcode-screen.Complete. After the code screen it fills
CLERK_TEST_CODEand waits for the home to showSigned in asthe seeded user's email with that user's ID. Screenshotsigned-in.Proof. The spec passes, and screenshot
signed-inshows the home with the seeded user's email and ID.
Gotchas
- The spec checks the code field a second time after 3 seconds. A sign-in that shows the code screen for a moment and then leaves it would pass a single visibility check.
- The standard instance has the email link off, because a test address gets no mail, so a run has no link to follow. With the link on, AuthView opens the email-link screen first. It has the same title as the code screen, "Check your email", and no code field, so
clerk.auth.signIn.codetells them apart. A spec that needs the link setsauth_email.sign_in_strategiesandauth_email.verification_strategieswithhost.useSettings.