-
Notifications
You must be signed in to change notification settings - Fork 276
/
Copy pathLogoutOptions.html
29 lines (29 loc) · 19.5 KB
/
LogoutOptions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LogoutOptions | @auth0/auth0-react</title><meta name="description" content="Documentation for @auth0/auth0-react"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@auth0/auth0-react</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@auth0/auth0-react</a></li><li><a href="LogoutOptions.html">LogoutOptions</a></li></ul><h1>Interface LogoutOptions</h1></div><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">LogoutOptions</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="LogoutOptions.html#clientId">clientId</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="LogoutOptions.html#logoutParams">logoutParams</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">federated</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">returnTo</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>[<span class="tsd-kind-index-signature">key</span>: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="LogoutOptions.html#openUrl">openUrl</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">url</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">Omit</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">SPALogoutOptions</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"onRedirect"</span><span class="tsd-signature-symbol">></span><ul class="tsd-hierarchy"><li><span class="target">LogoutOptions</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/auth0/auth0-react/blob/4efd44fbc5dead4c393197ad7965b11904dca3bc/src/auth0-context.tsx#L18">src/auth0-context.tsx:18</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="LogoutOptions.html#clientId" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>client<wbr/>Id?</span></a>
<a href="LogoutOptions.html#logoutParams" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>logout<wbr/>Params?</span></a>
<a href="LogoutOptions.html#openUrl" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>open<wbr/>Url?</span></a>
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="clientId" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>client<wbr/>Id</span><a href="#clientId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">client<wbr/>Id</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>The <code>clientId</code> of your application.</p>
<p>If this property is not set, then the <code>clientId</code> that was used during initialization of the SDK is sent to the logout endpoint.</p>
<p>If this property is set to <code>null</code>, then no client ID value is sent to the logout endpoint.</p>
<p><a href="https://auth0.com/docs/logout/guides/redirect-users-after-logout">Read more about how redirecting after logout works</a></p>
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from Omit.clientId</p><ul><li>Defined in node_modules/@auth0/auth0-spa-js/dist/typings/global.d.ts:389</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="logoutParams" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>logout<wbr/>Params</span><a href="#logoutParams" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">logout<wbr/>Params</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">federated</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">returnTo</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span>[<span class="tsd-kind-index-signature">key</span>: <span class="tsd-signature-type">string</span>]<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><div class="tsd-comment tsd-typography"><p>Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters
you wish to provide.</p>
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-index-signature"><h5><span class="tsd-signature-symbol">[</span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>If you need to send custom parameters to the logout endpoint, make sure to use the original parameter name.</p>
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">federated</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>When supported by the upstream identity provider,
forces the user to logout of their identity provider
and from Auth0.
<a href="https://auth0.com/docs/logout/guides/logout-idps">Read more about how federated logout works at Auth0</a></p>
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">return<wbr/>To</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The URL where Auth0 will redirect your browser to after the logout.</p>
<p><strong>Note</strong>: If the <code>client_id</code> parameter is included, the
<code>returnTo</code> URL that is provided must be listed in the
Application's "Allowed Logout URLs" in the Auth0 dashboard.
However, if the <code>client_id</code> parameter is not included, the
<code>returnTo</code> URL must be listed in the "Allowed Logout URLs" at
the account level in the Auth0 dashboard.</p>
<p><a href="https://auth0.com/docs/logout/guides/redirect-users-after-logout">Read more about how redirecting after logout works</a></p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from Omit.logoutParams</p><ul><li>Defined in node_modules/@auth0/auth0-spa-js/dist/typings/global.d.ts:394</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="openUrl" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>open<wbr/>Url</span><a href="#openUrl" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">open<wbr/>Url</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">url</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Used to control the redirect and not rely on the SDK to do the actual redirect.</p>
<p>Set to <code>false</code> to disable the redirect, or provide a function to handle the actual redirect yourself.</p>
</div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">url</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">url</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"><h4>Example</h4><pre><code class="language-ts"><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-5">auth0</span><span class="hl-1">.</span><span class="hl-0">logout</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-0">openUrl</span><span class="hl-1">(</span><span class="hl-5">url</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">window</span><span class="hl-1">.</span><span class="hl-5">location</span><span class="hl-1">.</span><span class="hl-0">replace</span><span class="hl-1">(</span><span class="hl-5">url</span><span class="hl-1">);</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code><button>Copy</button></pre>
<h4>Example</h4><pre><code class="language-ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Browser</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@capacitor/browser'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-5">auth0</span><span class="hl-1">.</span><span class="hl-0">logout</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-6">async</span><span class="hl-1"> </span><span class="hl-0">openUrl</span><span class="hl-1">(</span><span class="hl-5">url</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-4">await</span><span class="hl-1"> </span><span class="hl-5">Browser</span><span class="hl-1">.</span><span class="hl-0">open</span><span class="hl-1">({ </span><span class="hl-5">url</span><span class="hl-1"> });</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code><button>Copy</button></pre>
</div><aside class="tsd-sources"><p>Inherited from Omit.openUrl</p><ul><li>Defined in node_modules/@auth0/auth0-spa-js/dist/typings/global.d.ts:455</li></ul></aside></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#clientId" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>client<wbr/>Id</span></a><a href="#logoutParams" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>logout<wbr/>Params</span></a><a href="#openUrl" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>open<wbr/>Url</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@auth0/auth0-react</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>