import{s as ht,o as pt,n as ct}from"../chunks/scheduler.6062bdaf.js";import{S as ft,i as mt,g as i,s,r as h,A as dt,h as r,f as n,c as o,j as z,u as p,x as _,k as K,y as g,a,v as c,d as f,t as m,w as d,m as _t,n as bt}from"../chunks/index.4bca734e.js";import{T as $t}from"../chunks/Tip.b9ac1f03.js";import{D as pe}from"../chunks/Docstring.ff53aa02.js";import{C as ut}from"../chunks/CodeBlock.cbbddafc.js";import{E as Mt}from"../chunks/ExampleCodeBlock.d2834193.js";import{H as U,E as jt}from"../chunks/index.60dd99e8.js";function At(ee){let l;return{c(){l=_t("You might also be interested in [a practical example that demonstrates OAuth in action](https://huggingface.co/spaces/Wauplin/fastapi-oauth/blob/main/app.py).")},l(M){l=bt(M,"You might also be interested in [a practical example that demonstrates OAuth in action](https://huggingface.co/spaces/Wauplin/fastapi-oauth/blob/main/app.py).")},m(M,I){a(M,l,I)},d(M){M&&n(l)}}}function It(ee){let l,M="Example:",I,y,v;return y=new ut({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGF0dGFjaF9odWdnaW5nZmFjZV9vYXV0aCUyQyUyMHBhcnNlX2h1Z2dpbmdmYWNlX29hdXRoJTBBJTBBJTIzJTIwQ3JlYXRlJTIwYSUyMEZhc3RBUEklMjBhcHAlMEFhcHAlMjAlM0QlMjBGYXN0QVBJKCklMEElMEElMjMlMjBBZGQlMjBPQXV0aCUyMGVuZHBvaW50cyUyMHRvJTIwdGhlJTIwRmFzdEFQSSUyMGFwcCUwQWF0dGFjaF9odWdnaW5nZmFjZV9vYXV0aChhcHApJTBBJTBBJTIzJTIwQWRkJTIwYSUyMHJvdXRlJTIwdGhhdCUyMGdyZWV0cyUyMHRoZSUyMHVzZXIlMjBpZiUyMHRoZXklMjBhcmUlMjBsb2dnZWQlMjBpbiUwQSU0MGFwcC5nZXQoJTIyJTJGJTIyKSUwQWRlZiUyMGdyZWV0X2pzb24ocmVxdWVzdCUzQSUyMFJlcXVlc3QpJTNBJTBBJTIwJTIwJTIwJTIwJTIzJTIwUmV0cmlldmUlMjB0aGUlMjBPQXV0aCUyMGluZm8lMjBmcm9tJTIwdGhlJTIwcmVxdWVzdCUwQSUyMCUyMCUyMCUyMG9hdXRoX2luZm8lMjAlM0QlMjBwYXJzZV9odWdnaW5nZmFjZV9vYXV0aChyZXF1ZXN0KSUyMCUyMCUyMyUyMGUuZy4lMjBPQXV0aEluZm8lMjBkYXRhY2xhc3MlMEElMjAlMjAlMjAlMjBpZiUyMG9hdXRoX2luZm8lMjBpcyUyME5vbmUlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMjJtc2clMjIlM0ElMjAlMjJOb3QlMjBsb2dnZWQlMjBpbiElMjIlN0QlMEElMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMjJtc2clMjIlM0ElMjBmJTIySGVsbG8lMkMlMjAlN0JvYXV0aF9pbmZvLnVzZXJfaW5mby5wcmVmZXJyZWRfdXNlcm5hbWUlN0QhJTIyJTdE",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> attach_huggingface_oauth, parse_huggingface_oauth

<span class="hljs-comment"># Create a FastAPI app</span>
app = FastAPI()

<span class="hljs-comment"># Add OAuth endpoints to the FastAPI app</span>
attach_huggingface_oauth(app)

<span class="hljs-comment"># Add a route that greets the user if they are logged in</span>
<span class="hljs-meta">@app.get(<span class="hljs-params"><span class="hljs-string">&quot;/&quot;</span></span>)</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">greet_json</span>(<span class="hljs-params">request: Request</span>):
    <span class="hljs-comment"># Retrieve the OAuth info from the request</span>
    oauth_info = parse_huggingface_oauth(request)  <span class="hljs-comment"># e.g. OAuthInfo dataclass</span>
    <span class="hljs-keyword">if</span> oauth_info <span class="hljs-keyword">is</span> <span class="hljs-literal">None</span>:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;msg&quot;</span>: <span class="hljs-string">&quot;Not logged in!&quot;</span>}
    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;msg&quot;</span>: <span class="hljs-string">f&quot;Hello, <span class="hljs-subst">{oauth_info.user_info.preferred_username}</span>!&quot;</span>}`,wrap:!1}}),{c(){l=i("p"),l.textContent=M,I=s(),h(y.$$.fragment)},l(u){l=r(u,"P",{"data-svelte-h":!0}),_(l)!=="svelte-11lpom8"&&(l.textContent=M),I=o(u),p(y.$$.fragment,u)},m(u,O){a(u,l,O),a(u,I,O),c(y,u,O),v=!0},p:ct,i(u){v||(f(y.$$.fragment,u),v=!0)},o(u){m(y.$$.fragment,u),v=!1},d(u){u&&(n(l),n(I)),d(y,u)}}}function yt(ee){let l,M,I,y,v,u,O,Se=`OAuth is an open standard for access delegation, commonly used to grant applications limited access to a user’s information without exposing their credentials. When combined with FastAPI it allows you to build secure APIs that allow users to log in using external identity providers like Google or GitHub.
In a usual scenario:`,ce,k,Ye="<li>FastAPI will define the API endpoints and handles the HTTP requests.</li> <li>OAuth is integrated using libraries like fastapi.security or external tools like Authlib.</li> <li>When a user wants to log in, FastAPI redirects them to the OAuth provider’s login page.</li> <li>After successful login, the provider redirects back with a token.</li> <li>FastAPI verifies this token and uses it to authorize the user or fetch user profile data.</li>",fe,Z,De="This approach helps avoid handling passwords directly and offloads identity management to trusted providers.",me,F,de,B,ze="This module provides tools to integrate Hugging Face OAuth into a FastAPI application. It enables user authentication using the Hugging Face platform including mocked behavior for local development and real OAuth flow for Spaces.",_e,E,be,X,Ke='The <code>attach_huggingface_oauth</code> function adds login, logout, and callback endpoints to your FastAPI app. When used in a Space, it connects to the Hugging Face OAuth system. When used locally it will inject a mocked user. Click here to learn more about <a href="https://huggingface.co/docs/hub/en/spaces-oauth" rel="nofollow">adding a Sign-In with HF option to your Space</a>',$e,V,Me,H,je,C,Ae,W,Ie,b,G,Xe,te,et="Add OAuth endpoints to a FastAPI app to enable OAuth login with Hugging Face.",Ve,ne,tt="How to use:",He,ae,nt='<li>Call this method on your FastAPI app to add the OAuth endpoints.</li> <li>Inside your route handlers, call <code>parse_huggingface_oauth(request)</code> to retrieve the OAuth info.</li> <li>If user is logged in, an <a href="/docs/huggingface_hub/main/en/package_reference/oauth#huggingface_hub.OAuthInfo">OAuthInfo</a> object is returned with the user’s info. If not, <code>None</code> is returned.</li> <li>In your app, make sure to add links to <code>/oauth/huggingface/login</code> and <code>/oauth/huggingface/logout</code> for the user to log in and out.</li>',We,J,ye,P,ve,$,q,Ge,se,at='Returns the information from a logged in user as a <a href="/docs/huggingface_hub/main/en/package_reference/oauth#huggingface_hub.OAuthInfo">OAuthInfo</a> object.',Pe,oe,st=`For flexibility and future-proofing, this method is very lax in its parsing and does not raise errors.
Missing fields are set to <code>None</code> without a warning.`,qe,ie,ot="Return <code>None</code>, if the user is not logged in (no info in session cookie).",Ne,re,it='See <a href="/docs/huggingface_hub/main/en/package_reference/oauth#huggingface_hub.attach_huggingface_oauth">attach_huggingface_oauth()</a> for an example on how to use this method.',Oe,N,we,w,R,Re,le,rt="Information about an organization linked to a user logged in with OAuth.",xe,Q,Te,x,L,Qe,ge,lt="Information about a user logged in with OAuth.",Ue,S,Ce,T,Y,Le,ue,gt="Information about the OAuth login.",Je,D,ke,he,Ze;return v=new U({props:{title:"OAuth and FastAPI",local:"oauth-and-fastapi",headingTag:"h1"}}),F=new U({props:{title:"Hugging Face OAuth Integration in FastAPI",local:"hugging-face-oauth-integration-in-fastapi",headingTag:"h1"}}),E=new U({props:{title:"OAuth Overview",local:"oauth-overview",headingTag:"h2"}}),V=new U({props:{title:"How to use it?",local:"how-to-use-it",headingTag:"h3"}}),H=new ut({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGF0dGFjaF9odWdnaW5nZmFjZV9vYXV0aCUyQyUyMHBhcnNlX2h1Z2dpbmdmYWNlX29hdXRoJTBBZnJvbSUyMGZhc3RhcGklMjBpbXBvcnQlMjBGYXN0QVBJJTJDJTIwUmVxdWVzdCUwQSUwQWFwcCUyMCUzRCUyMEZhc3RBUEkoKSUwQWF0dGFjaF9odWdnaW5nZmFjZV9vYXV0aChhcHApJTBBJTBBJTQwYXBwLmdldCglMjIlMkYlMjIpJTBBZGVmJTIwZ3JlZXRfanNvbihyZXF1ZXN0JTNBJTIwUmVxdWVzdCklM0ElMEElMjAlMjAlMjAlMjBvYXV0aF9pbmZvJTIwJTNEJTIwcGFyc2VfaHVnZ2luZ2ZhY2Vfb2F1dGgocmVxdWVzdCklMEElMjAlMjAlMjAlMjBpZiUyMG9hdXRoX2luZm8lMjBpcyUyME5vbmUlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMjJtc2clMjIlM0ElMjAlMjJOb3QlMjBsb2dnZWQlMjBpbiElMjIlN0QlMEElMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMjJtc2clMjIlM0ElMjBmJTIySGVsbG8lMkMlMjAlN0JvYXV0aF9pbmZvLnVzZXJfaW5mby5wcmVmZXJyZWRfdXNlcm5hbWUlN0QhJTIyJTdE",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> attach_huggingface_oauth, parse_huggingface_oauth
<span class="hljs-keyword">from</span> fastapi <span class="hljs-keyword">import</span> FastAPI, Request

app = FastAPI()
attach_huggingface_oauth(app)

<span class="hljs-meta">@app.get(<span class="hljs-params"><span class="hljs-string">&quot;/&quot;</span></span>)</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">greet_json</span>(<span class="hljs-params">request: Request</span>):
    oauth_info = parse_huggingface_oauth(request)
    <span class="hljs-keyword">if</span> oauth_info <span class="hljs-keyword">is</span> <span class="hljs-literal">None</span>:
        <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;msg&quot;</span>: <span class="hljs-string">&quot;Not logged in!&quot;</span>}
    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;msg&quot;</span>: <span class="hljs-string">f&quot;Hello, <span class="hljs-subst">{oauth_info.user_info.preferred_username}</span>!&quot;</span>}`,wrap:!1}}),C=new $t({props:{$$slots:{default:[At]},$$scope:{ctx:ee}}}),W=new U({props:{title:"attach_huggingface_oauth",local:"huggingface_hub.attach_huggingface_oauth",headingTag:"h3"}}),G=new pe({props:{name:"huggingface_hub.attach_huggingface_oauth",anchor:"huggingface_hub.attach_huggingface_oauth",parameters:[{name:"app",val:": fastapi.FastAPI"},{name:"route_prefix",val:": str = '/'"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_oauth.py#L127"}}),J=new Mt({props:{anchor:"huggingface_hub.attach_huggingface_oauth.example",$$slots:{default:[It]},$$scope:{ctx:ee}}}),P=new U({props:{title:"parse_huggingface_oauth",local:"huggingface_hub.parse_huggingface_oauth",headingTag:"h3"}}),q=new pe({props:{name:"huggingface_hub.parse_huggingface_oauth",anchor:"huggingface_hub.parse_huggingface_oauth",parameters:[{name:"request",val:": fastapi.Request"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_oauth.py#L194"}}),N=new U({props:{title:"OAuthOrgInfo",local:"huggingface_hub.OAuthOrgInfo",headingTag:"h3"}}),R=new pe({props:{name:"class huggingface_hub.OAuthOrgInfo",anchor:"huggingface_hub.OAuthOrgInfo",parameters:[{name:"sub",val:": str"},{name:"name",val:": str"},{name:"preferred_username",val:": str"},{name:"picture",val:": str"},{name:"is_enterprise",val:": bool"},{name:"can_pay",val:": typing.Optional[bool] = None"},{name:"role_in_org",val:": typing.Optional[str] = None"},{name:"pending_sso",val:": typing.Optional[bool] = None"},{name:"missing_mfa",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"huggingface_hub.OAuthOrgInfo.sub",description:`<strong>sub</strong> (<code>str</code>) &#x2014;
Unique identifier for the org. OpenID Connect field.`,name:"sub"},{anchor:"huggingface_hub.OAuthOrgInfo.name",description:`<strong>name</strong> (<code>str</code>) &#x2014;
The org&#x2019;s full name. OpenID Connect field.`,name:"name"},{anchor:"huggingface_hub.OAuthOrgInfo.preferred_username",description:`<strong>preferred_username</strong> (<code>str</code>) &#x2014;
The org&#x2019;s username. OpenID Connect field.`,name:"preferred_username"},{anchor:"huggingface_hub.OAuthOrgInfo.picture",description:`<strong>picture</strong> (<code>str</code>) &#x2014;
The org&#x2019;s profile picture URL. OpenID Connect field.`,name:"picture"},{anchor:"huggingface_hub.OAuthOrgInfo.is_enterprise",description:`<strong>is_enterprise</strong> (<code>bool</code>) &#x2014;
Whether the org is an enterprise org. Hugging Face field.`,name:"is_enterprise"},{anchor:"huggingface_hub.OAuthOrgInfo.can_pay",description:`<strong>can_pay</strong> (<code>Optional[bool]</code>, <em>optional</em>) &#x2014;
Whether the org has a payment method set up. Hugging Face field.`,name:"can_pay"},{anchor:"huggingface_hub.OAuthOrgInfo.role_in_org",description:`<strong>role_in_org</strong> (<code>Optional[str]</code>, <em>optional</em>) &#x2014;
The user&#x2019;s role in the org. Hugging Face field.`,name:"role_in_org"},{anchor:"huggingface_hub.OAuthOrgInfo.pending_sso",description:`<strong>pending_sso</strong> (<code>Optional[bool]</code>, <em>optional</em>) &#x2014;
Indicates if the user granted the OAuth app access to the org but didn&#x2019;t complete SSO. Hugging Face field.`,name:"pending_sso"},{anchor:"huggingface_hub.OAuthOrgInfo.missing_mfa",description:`<strong>missing_mfa</strong> (<code>Optional[bool]</code>, <em>optional</em>) &#x2014;
Indicates if the user granted the OAuth app access to the org but didn&#x2019;t complete MFA. Hugging Face field.`,name:"missing_mfa"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_oauth.py#L22"}}),Q=new U({props:{title:"OAuthUserInfo",local:"huggingface_hub.OAuthUserInfo",headingTag:"h3"}}),L=new pe({props:{name:"class huggingface_hub.OAuthUserInfo",anchor:"huggingface_hub.OAuthUserInfo",parameters:[{name:"sub",val:": str"},{name:"name",val:": str"},{name:"preferred_username",val:": str"},{name:"email_verified",val:": typing.Optional[bool]"},{name:"email",val:": typing.Optional[str]"},{name:"picture",val:": str"},{name:"profile",val:": str"},{name:"website",val:": typing.Optional[str]"},{name:"is_pro",val:": bool"},{name:"can_pay",val:": typing.Optional[bool]"},{name:"orgs",val:": typing.Optional[typing.List[huggingface_hub._oauth.OAuthOrgInfo]]"}],parametersDescription:[{anchor:"huggingface_hub.OAuthUserInfo.sub",description:`<strong>sub</strong> (<code>str</code>) &#x2014;
Unique identifier for the user, even in case of rename. OpenID Connect field.`,name:"sub"},{anchor:"huggingface_hub.OAuthUserInfo.name",description:`<strong>name</strong> (<code>str</code>) &#x2014;
The user&#x2019;s full name. OpenID Connect field.`,name:"name"},{anchor:"huggingface_hub.OAuthUserInfo.preferred_username",description:`<strong>preferred_username</strong> (<code>str</code>) &#x2014;
The user&#x2019;s username. OpenID Connect field.`,name:"preferred_username"},{anchor:"huggingface_hub.OAuthUserInfo.email_verified",description:`<strong>email_verified</strong> (<code>Optional[bool]</code>, <em>optional</em>) &#x2014;
Indicates if the user&#x2019;s email is verified. OpenID Connect field.`,name:"email_verified"},{anchor:"huggingface_hub.OAuthUserInfo.email",description:`<strong>email</strong> (<code>Optional[str]</code>, <em>optional</em>) &#x2014;
The user&#x2019;s email address. OpenID Connect field.`,name:"email"},{anchor:"huggingface_hub.OAuthUserInfo.picture",description:`<strong>picture</strong> (<code>str</code>) &#x2014;
The user&#x2019;s profile picture URL. OpenID Connect field.`,name:"picture"},{anchor:"huggingface_hub.OAuthUserInfo.profile",description:`<strong>profile</strong> (<code>str</code>) &#x2014;
The user&#x2019;s profile URL. OpenID Connect field.`,name:"profile"},{anchor:"huggingface_hub.OAuthUserInfo.website",description:`<strong>website</strong> (<code>Optional[str]</code>, <em>optional</em>) &#x2014;
The user&#x2019;s website URL. OpenID Connect field.`,name:"website"},{anchor:"huggingface_hub.OAuthUserInfo.is_pro",description:`<strong>is_pro</strong> (<code>bool</code>) &#x2014;
Whether the user is a pro user. Hugging Face field.`,name:"is_pro"},{anchor:"huggingface_hub.OAuthUserInfo.can_pay",description:`<strong>can_pay</strong> (<code>Optional[bool]</code>, <em>optional</em>) &#x2014;
Whether the user has a payment method set up. Hugging Face field.`,name:"can_pay"},{anchor:"huggingface_hub.OAuthUserInfo.orgs",description:`<strong>orgs</strong> (<code>Optional[List[OrgInfo]]</code>, <em>optional</em>) &#x2014;
List of organizations the user is part of. Hugging Face field.`,name:"orgs"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_oauth.py#L59"}}),S=new U({props:{title:"OAuthInfo",local:"huggingface_hub.OAuthInfo",headingTag:"h3"}}),Y=new pe({props:{name:"class huggingface_hub.OAuthInfo",anchor:"huggingface_hub.OAuthInfo",parameters:[{name:"access_token",val:": str"},{name:"access_token_expires_at",val:": datetime"},{name:"user_info",val:": OAuthUserInfo"},{name:"state",val:": typing.Optional[str]"},{name:"scope",val:": str"}],parametersDescription:[{anchor:"huggingface_hub.OAuthInfo.access_token",description:`<strong>access_token</strong> (<code>str</code>) &#x2014;
The access token.`,name:"access_token"},{anchor:"huggingface_hub.OAuthInfo.access_token_expires_at",description:`<strong>access_token_expires_at</strong> (<code>datetime.datetime</code>) &#x2014;
The expiration date of the access token.`,name:"access_token_expires_at"},{anchor:"huggingface_hub.OAuthInfo.user_info",description:`<strong>user_info</strong> (<a href="/docs/huggingface_hub/main/en/package_reference/oauth#huggingface_hub.OAuthUserInfo">OAuthUserInfo</a>) &#x2014;
The user information.`,name:"user_info"},{anchor:"huggingface_hub.OAuthInfo.state",description:`<strong>state</strong> (<code>str</code>, <em>optional</em>) &#x2014;
State passed to the OAuth provider in the original request to the OAuth provider.`,name:"state"},{anchor:"huggingface_hub.OAuthInfo.scope",description:`<strong>scope</strong> (<code>str</code>) &#x2014;
Granted scope.`,name:"scope"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_oauth.py#L102"}}),D=new jt({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/oauth.md"}}),{c(){l=i("meta"),M=s(),I=i("p"),y=s(),h(v.$$.fragment),u=s(),O=i("p"),O.textContent=Se,ce=s(),k=i("ul"),k.innerHTML=Ye,fe=s(),Z=i("p"),Z.textContent=De,me=s(),h(F.$$.fragment),de=s(),B=i("p"),B.textContent=ze,_e=s(),h(E.$$.fragment),be=s(),X=i("p"),X.innerHTML=Ke,$e=s(),h(V.$$.fragment),Me=s(),h(H.$$.fragment),je=s(),h(C.$$.fragment),Ae=s(),h(W.$$.fragment),Ie=s(),b=i("div"),h(G.$$.fragment),Xe=s(),te=i("p"),te.textContent=et,Ve=s(),ne=i("p"),ne.textContent=tt,He=s(),ae=i("ul"),ae.innerHTML=nt,We=s(),h(J.$$.fragment),ye=s(),h(P.$$.fragment),ve=s(),$=i("div"),h(q.$$.fragment),Ge=s(),se=i("p"),se.innerHTML=at,Pe=s(),oe=i("p"),oe.innerHTML=st,qe=s(),ie=i("p"),ie.innerHTML=ot,Ne=s(),re=i("p"),re.innerHTML=it,Oe=s(),h(N.$$.fragment),we=s(),w=i("div"),h(R.$$.fragment),Re=s(),le=i("p"),le.textContent=rt,xe=s(),h(Q.$$.fragment),Te=s(),x=i("div"),h(L.$$.fragment),Qe=s(),ge=i("p"),ge.textContent=lt,Ue=s(),h(S.$$.fragment),Ce=s(),T=i("div"),h(Y.$$.fragment),Le=s(),ue=i("p"),ue.textContent=gt,Je=s(),h(D.$$.fragment),ke=s(),he=i("p"),this.h()},l(e){const t=dt("svelte-u9bgzb",document.head);l=r(t,"META",{name:!0,content:!0}),t.forEach(n),M=o(e),I=r(e,"P",{}),z(I).forEach(n),y=o(e),p(v.$$.fragment,e),u=o(e),O=r(e,"P",{"data-svelte-h":!0}),_(O)!=="svelte-1jlhota"&&(O.textContent=Se),ce=o(e),k=r(e,"UL",{"data-svelte-h":!0}),_(k)!=="svelte-12skaqt"&&(k.innerHTML=Ye),fe=o(e),Z=r(e,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-tww4as"&&(Z.textContent=De),me=o(e),p(F.$$.fragment,e),de=o(e),B=r(e,"P",{"data-svelte-h":!0}),_(B)!=="svelte-1jzflbu"&&(B.textContent=ze),_e=o(e),p(E.$$.fragment,e),be=o(e),X=r(e,"P",{"data-svelte-h":!0}),_(X)!=="svelte-sqe3e6"&&(X.innerHTML=Ke),$e=o(e),p(V.$$.fragment,e),Me=o(e),p(H.$$.fragment,e),je=o(e),p(C.$$.fragment,e),Ae=o(e),p(W.$$.fragment,e),Ie=o(e),b=r(e,"DIV",{class:!0});var j=z(b);p(G.$$.fragment,j),Xe=o(j),te=r(j,"P",{"data-svelte-h":!0}),_(te)!=="svelte-m9n3hj"&&(te.textContent=et),Ve=o(j),ne=r(j,"P",{"data-svelte-h":!0}),_(ne)!=="svelte-1rqu6lm"&&(ne.textContent=tt),He=o(j),ae=r(j,"UL",{"data-svelte-h":!0}),_(ae)!=="svelte-iazu9p"&&(ae.innerHTML=nt),We=o(j),p(J.$$.fragment,j),j.forEach(n),ye=o(e),p(P.$$.fragment,e),ve=o(e),$=r(e,"DIV",{class:!0});var A=z($);p(q.$$.fragment,A),Ge=o(A),se=r(A,"P",{"data-svelte-h":!0}),_(se)!=="svelte-ke8nih"&&(se.innerHTML=at),Pe=o(A),oe=r(A,"P",{"data-svelte-h":!0}),_(oe)!=="svelte-4ig96s"&&(oe.innerHTML=st),qe=o(A),ie=r(A,"P",{"data-svelte-h":!0}),_(ie)!=="svelte-1ux1b45"&&(ie.innerHTML=ot),Ne=o(A),re=r(A,"P",{"data-svelte-h":!0}),_(re)!=="svelte-clgwg2"&&(re.innerHTML=it),A.forEach(n),Oe=o(e),p(N.$$.fragment,e),we=o(e),w=r(e,"DIV",{class:!0});var Fe=z(w);p(R.$$.fragment,Fe),Re=o(Fe),le=r(Fe,"P",{"data-svelte-h":!0}),_(le)!=="svelte-ur89v"&&(le.textContent=rt),Fe.forEach(n),xe=o(e),p(Q.$$.fragment,e),Te=o(e),x=r(e,"DIV",{class:!0});var Be=z(x);p(L.$$.fragment,Be),Qe=o(Be),ge=r(Be,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-1lrcldb"&&(ge.textContent=lt),Be.forEach(n),Ue=o(e),p(S.$$.fragment,e),Ce=o(e),T=r(e,"DIV",{class:!0});var Ee=z(T);p(Y.$$.fragment,Ee),Le=o(Ee),ue=r(Ee,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-1ysqsmg"&&(ue.textContent=gt),Ee.forEach(n),Je=o(e),p(D.$$.fragment,e),ke=o(e),he=r(e,"P",{}),z(he).forEach(n),this.h()},h(){K(l,"name","hf:doc:metadata"),K(l,"content",vt),K(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){g(document.head,l),a(e,M,t),a(e,I,t),a(e,y,t),c(v,e,t),a(e,u,t),a(e,O,t),a(e,ce,t),a(e,k,t),a(e,fe,t),a(e,Z,t),a(e,me,t),c(F,e,t),a(e,de,t),a(e,B,t),a(e,_e,t),c(E,e,t),a(e,be,t),a(e,X,t),a(e,$e,t),c(V,e,t),a(e,Me,t),c(H,e,t),a(e,je,t),c(C,e,t),a(e,Ae,t),c(W,e,t),a(e,Ie,t),a(e,b,t),c(G,b,null),g(b,Xe),g(b,te),g(b,Ve),g(b,ne),g(b,He),g(b,ae),g(b,We),c(J,b,null),a(e,ye,t),c(P,e,t),a(e,ve,t),a(e,$,t),c(q,$,null),g($,Ge),g($,se),g($,Pe),g($,oe),g($,qe),g($,ie),g($,Ne),g($,re),a(e,Oe,t),c(N,e,t),a(e,we,t),a(e,w,t),c(R,w,null),g(w,Re),g(w,le),a(e,xe,t),c(Q,e,t),a(e,Te,t),a(e,x,t),c(L,x,null),g(x,Qe),g(x,ge),a(e,Ue,t),c(S,e,t),a(e,Ce,t),a(e,T,t),c(Y,T,null),g(T,Le),g(T,ue),a(e,Je,t),c(D,e,t),a(e,ke,t),a(e,he,t),Ze=!0},p(e,[t]){const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),C.$set(j);const A={};t&2&&(A.$$scope={dirty:t,ctx:e}),J.$set(A)},i(e){Ze||(f(v.$$.fragment,e),f(F.$$.fragment,e),f(E.$$.fragment,e),f(V.$$.fragment,e),f(H.$$.fragment,e),f(C.$$.fragment,e),f(W.$$.fragment,e),f(G.$$.fragment,e),f(J.$$.fragment,e),f(P.$$.fragment,e),f(q.$$.fragment,e),f(N.$$.fragment,e),f(R.$$.fragment,e),f(Q.$$.fragment,e),f(L.$$.fragment,e),f(S.$$.fragment,e),f(Y.$$.fragment,e),f(D.$$.fragment,e),Ze=!0)},o(e){m(v.$$.fragment,e),m(F.$$.fragment,e),m(E.$$.fragment,e),m(V.$$.fragment,e),m(H.$$.fragment,e),m(C.$$.fragment,e),m(W.$$.fragment,e),m(G.$$.fragment,e),m(J.$$.fragment,e),m(P.$$.fragment,e),m(q.$$.fragment,e),m(N.$$.fragment,e),m(R.$$.fragment,e),m(Q.$$.fragment,e),m(L.$$.fragment,e),m(S.$$.fragment,e),m(Y.$$.fragment,e),m(D.$$.fragment,e),Ze=!1},d(e){e&&(n(M),n(I),n(y),n(u),n(O),n(ce),n(k),n(fe),n(Z),n(me),n(de),n(B),n(_e),n(be),n(X),n($e),n(Me),n(je),n(Ae),n(Ie),n(b),n(ye),n(ve),n($),n(Oe),n(we),n(w),n(xe),n(Te),n(x),n(Ue),n(Ce),n(T),n(Je),n(ke),n(he)),n(l),d(v,e),d(F,e),d(E,e),d(V,e),d(H,e),d(C,e),d(W,e),d(G),d(J),d(P,e),d(q),d(N,e),d(R),d(Q,e),d(L),d(S,e),d(Y),d(D,e)}}}const vt='{"title":"OAuth and FastAPI","local":"oauth-and-fastapi","sections":[],"depth":1}';function Ot(ee){return pt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zt extends ft{constructor(l){super(),mt(this,l,Ot,yt,ht,{})}}export{Zt as component};
