# User:Logout

## Example {#example}


::tabs

::tab antlers
```antlers
{{ if should_logout_for_whatever_reason }}
  {{ user:logout redirect="/somewhere" }}
{{ /if }}
```
::tab blade
```blade
@if ($should_logout_for_whatever_reason)
  <s:user:logout redirect="/somewhere" />
@endif
```
::

This will immediately log a user out and redirect to `/somewhere` if the condition is met.

If you'd like to just output a link, use the [`user:logout_url`](/tags/user-logout_url.md) tag.
