# Email Verification

Email account verification is enabled by default. After signing up, a user will be asked to verify their email using a time-sensitive link sent to their registered email address.

Until verified, the JWT token issued to a user will contain an `unverified` flag, and access to protected API endpoints will be disabled.&#x20;

You can override this behaviour by passing an `unverified` permission to an API route as the third parameter.

<pre class="language-javascript"><code class="lang-javascript"><strong>// node.js
</strong><strong>api.get('/api/account', auth.verify('owner', 'account.read', 'unverified'), use(accountController.get));
</strong><strong>
</strong><strong>// next.js
</strong>export const GET = withApiRoute('owner', 'account.read', accountController.get, { allowUnverified: true });
</code></pre>

When a user verifies their account by making a POST request to `/api/user/verify` a new JWT token will be issued that does not contain an unverified flag, unlocking the API access.

### Disable Email Verification

To disable the default behaviour and automatically verify all new users, you can set the following config flag to false:

```javascript
"email": {
  "user_verification": false
 }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-server/authentication/email-verification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
