> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Log in with email verification links

> Extract a magic login link from an email and navigate to it.

<Info>
  **Prerequisite**: A Momentic-provisioned inbox. [Request
  one](mailto:support@momentic.ai).
</Info>

## Fetch and navigate

```js theme={null}
const msg = await email.fetchLatest({
  inbox: "link+test",
  afterDate: new Date(Date.now() - 60_000),
  timeout: 30_000,
});

const [link] = msg.text.match(/https?:\/\/[^\s]+/) ?? [];
if (!link) throw new Error("No verification link found in email");
setVariable("VERIFICATION_LINK", link);
```

Then add a **Navigate** step with URL `{{ env.VERIFICATION_LINK }}`.

<Tip>
  This script polls for up to 30 seconds, well within the JavaScript step's **90
  second** default timeout. For longer polls, raise the step's **Timeout** field
  (cloud is platform-capped at 60s; CLI supports up to 10 minutes).
</Tip>

## Related

* [Email OTP](/guides/auth/email-otp)
* [Email integration](/integrations/email)
