---
url: "https://vueda.dev/v3/reference/api/py/vueda.user.decorators.md"
title: "user.decorators"
---

# user.decorators

## Overview

View decorators for user authentication concerns.

## `ensure_csrf_token` {#ensure_csrf_token}

Wraps a view function or class-based view to ensure a CSRF token is set on the request object
 if the user is authenticated.

### Signature {#ensure_csrf_token-signature}

`ensure_csrf_token(view_or_class)`

#### Parameters {#ensure_csrf_token-parameters}

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="ensure_csrf_token-param-view_or_class">view_or_class</span> |  | yes |  |  |

### Source {#ensure_csrf_token-source}

`server/vueda/user/decorators.py:11`

## Source

`server/vueda/user/decorators.py`
