Automated deployment: Sat Jan 11 09:57:38 UTC 2020 8fe1997dbc

This commit is contained in:
frankie567
2020-01-11 09:57:38 +00:00
parent 4305e2c4f7
commit b468d017a1
4 changed files with 23 additions and 16 deletions

View File

@@ -613,8 +613,7 @@
</pre></div>
<p>As you can see, instantiation is quite simple. You just have to define a constant <code>SECRET</code> which is used to encode the token and the lifetime of the cookie (in seconds).</p>
<p>You can optionally define the <code>cookie_name</code>. <strong>Defaults to <code>fastapiusersauth</code></strong>.</p>
<p>You can also optionally define the <code>name</code> which will be used to generate its <a href="../../../usage/routes/#post-loginname"><code>/login</code> route</a>. <strong>Defaults to <code>cookie</code></strong>.</p>
<p>You can optionally define the <code>name</code> which will be used to generate its <a href="../../../usage/routes/#post-loginname"><code>/login</code> route</a>. <strong>Defaults to <code>cookie</code></strong>.</p>
<div class="codehilite"><pre><span></span><span class="n">cookie_authentication</span> <span class="o">=</span> <span class="n">CookieAuthentication</span><span class="p">(</span>
<span class="n">secret</span><span class="o">=</span><span class="n">SECRET</span><span class="p">,</span>
<span class="n">lifetime_seconds</span><span class="o">=</span><span class="mi">3600</span><span class="p">,</span>
@@ -622,6 +621,14 @@
<span class="p">)</span>
</pre></div>
<p>You can also define the parameters for the generated cookie:</p>
<ul>
<li><code>cookie_name</code> (<code>fastapiusersauth</code>): Name of the cookie.</li>
<li><code>cookie_path</code> (<code>/</code>): Cookie path.</li>
<li><code>cookie_domain</code> (<code>None</code>): Cookie domain.</li>
<li><code>cookie_secure</code> (<code>True</code>): Whether to only send the cookie to the server via SSL request.</li>
<li><code>cookie_httponly</code> (<code>True</code>): Whether to prevent access to the cookie via JavaScript.</li>
</ul>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>The value of the cookie is actually a JWT. This authentication backend shares most of its logic with the <a href="../jwt/">JWT</a> one.</p>

View File

File diff suppressed because one or more lines are too long

View File

@@ -2,67 +2,67 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2020-01-09</lastmod>
<lastmod>2020-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

View File

Binary file not shown.