Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Web.nonce

Web.nonce() -> string

Description

Get the one-time random string generated for the current request.

This is used for CSP-protected tags and CSRF tokens.

<script nonce="{{ Web.nonce() }}"></script>

//= <script nonce="AET4bZuK..."></script>

Other Options

Instead of generating the script yourself, you can use the following, and the nonce will automatically be added:

See Also