# invalidate

The invalidate() method for the SurrealDB Mojo SDK invalidates the authentication for the current connection.

Invalidates the current session and clears the stored token.

```python title="Method Syntax"
client.invalidate(session)
```

## Arguments

<table>
    <thead>
        <tr>
            <th colspan="2" scope="col">Argument</th>
            <th colspan="2" scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="2" scope="row" data-label="Argument"><code>session</code></td>
            <td colspan="2" scope="row" data-label="Description">An optional session id.</td>
        </tr>
    </tbody>
</table>

## Example usage

```python
client.invalidate()
```

## See also

- [Authentication](/docs/reference/mojo/concepts/authentication.md)
- [`authenticate()`](/docs/reference/mojo/methods/authenticate.md)
