import{s as ht,o as ct,n as pt}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 c,x as _,k as K,y as g,a,v as p,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 ce}from"../chunks/Docstring.b6251191.js";import{C as ut}from"../chunks/CodeBlock.cbbddafc.js";import{E as Mt}from"../chunks/ExampleCodeBlock.8d71e6b1.js";import{H as U,E as jt}from"../chunks/getInferenceSnippets.b564dd8b.js";function yt(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).
For a more comprehensive implementation, check out [medoidai/GiveBackGPT](https://huggingface.co/spaces/medoidai/GiveBackGPT) Space which implements HF OAuth in a full-scale application.`)},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).
For a more comprehensive implementation, check out [medoidai/GiveBackGPT](https://huggingface.co/spaces/medoidai/GiveBackGPT) Space which implements HF OAuth in a full-scale application.`)},m(M,A){a(M,l,A)},d(M){M&&n(l)}}}function At(ee){let l,M="Example:",A,v,I;return v=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,A=s(),h(v.$$.fragment)},l(u){l=r(u,"P",{"data-svelte-h":!0}),_(l)!=="svelte-11lpom8"&&(l.textContent=M),A=o(u),c(v.$$.fragment,u)},m(u,O){a(u,l,O),a(u,A,O),p(v,u,O),I=!0},p:pt,i(u){I||(f(v.$$.fragment,u),I=!0)},o(u){m(v.$$.fragment,u),I=!1},d(u){u&&(n(l),n(A)),d(v,u)}}}function vt(ee){let l,M,A,v,I,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:`,pe,J,De="<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,B,Ye="This approach helps avoid handling passwords directly and offloads identity management to trusted providers.",me,F,de,Z,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,G,Me,H,je,C,ye,V,Ae,b,q,Xe,te,et="Add OAuth endpoints to a FastAPI app to enable OAuth login with Hugging Face.",Ge,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>',Ve,k,ve,P,Ie,$,W,qe,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.`,We,ie,ot="Return <code>None</code>, if the user is not logged in (no info in session cookie).",Re,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,R,xe,x,L,Le,le,rt="Information about an organization linked to a user logged in with OAuth.",we,N,Te,w,Q,Ne,ge,lt="Information about a user logged in with OAuth.",Ue,S,Ce,T,D,Qe,ue,gt="Information about the OAuth login.",ke,Y,Je,he,Be;return I=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"}}),G=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:[yt]},$$scope:{ctx:ee}}}),V=new U({props:{title:"attach_huggingface_oauth",local:"huggingface_hub.attach_huggingface_oauth",headingTag:"h3"}}),q=new ce({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#L124"}}),k=new Mt({props:{anchor:"huggingface_hub.attach_huggingface_oauth.example",$$slots:{default:[At]},$$scope:{ctx:ee}}}),P=new U({props:{title:"parse_huggingface_oauth",local:"huggingface_hub.parse_huggingface_oauth",headingTag:"h3"}}),W=new ce({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#L191"}}),R=new U({props:{title:"OAuthOrgInfo",local:"huggingface_hub.OAuthOrgInfo",headingTag:"h3"}}),L=new ce({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:"security_restrictions",val:": typing.Optional[typing.List[typing.Literal['ip', 'token-policy', 'mfa', 'sso']]] = 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.security_restrictions",description:`<strong>security_restrictions</strong> (<code>Optional[List[Literal[&quot;ip&quot;, &quot;token-policy&quot;, &quot;mfa&quot;, &quot;sso&quot;]]]</code>, <em>optional</em>) &#x2014;
Array of security restrictions that the user hasn&#x2019;t completed for this org. Possible values: &#x201C;ip&#x201D;, &#x201C;token-policy&#x201D;, &#x201C;mfa&#x201D;, &#x201C;sso&#x201D;. Hugging Face field.`,name:"security_restrictions"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_oauth.py#L22"}}),N=new U({props:{title:"OAuthUserInfo",local:"huggingface_hub.OAuthUserInfo",headingTag:"h3"}}),Q=new ce({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#L56"}}),S=new U({props:{title:"OAuthInfo",local:"huggingface_hub.OAuthInfo",headingTag:"h3"}}),D=new ce({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#L99"}}),Y=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(),A=i("p"),v=s(),h(I.$$.fragment),u=s(),O=i("p"),O.textContent=Se,pe=s(),J=i("ul"),J.innerHTML=De,fe=s(),B=i("p"),B.textContent=Ye,me=s(),h(F.$$.fragment),de=s(),Z=i("p"),Z.textContent=ze,_e=s(),h(E.$$.fragment),be=s(),X=i("p"),X.innerHTML=Ke,$e=s(),h(G.$$.fragment),Me=s(),h(H.$$.fragment),je=s(),h(C.$$.fragment),ye=s(),h(V.$$.fragment),Ae=s(),b=i("div"),h(q.$$.fragment),Xe=s(),te=i("p"),te.textContent=et,Ge=s(),ne=i("p"),ne.textContent=tt,He=s(),ae=i("ul"),ae.innerHTML=nt,Ve=s(),h(k.$$.fragment),ve=s(),h(P.$$.fragment),Ie=s(),$=i("div"),h(W.$$.fragment),qe=s(),se=i("p"),se.innerHTML=at,Pe=s(),oe=i("p"),oe.innerHTML=st,We=s(),ie=i("p"),ie.innerHTML=ot,Re=s(),re=i("p"),re.innerHTML=it,Oe=s(),h(R.$$.fragment),xe=s(),x=i("div"),h(L.$$.fragment),Le=s(),le=i("p"),le.textContent=rt,we=s(),h(N.$$.fragment),Te=s(),w=i("div"),h(Q.$$.fragment),Ne=s(),ge=i("p"),ge.textContent=lt,Ue=s(),h(S.$$.fragment),Ce=s(),T=i("div"),h(D.$$.fragment),Qe=s(),ue=i("p"),ue.textContent=gt,ke=s(),h(Y.$$.fragment),Je=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),A=r(e,"P",{}),z(A).forEach(n),v=o(e),c(I.$$.fragment,e),u=o(e),O=r(e,"P",{"data-svelte-h":!0}),_(O)!=="svelte-1jlhota"&&(O.textContent=Se),pe=o(e),J=r(e,"UL",{"data-svelte-h":!0}),_(J)!=="svelte-12skaqt"&&(J.innerHTML=De),fe=o(e),B=r(e,"P",{"data-svelte-h":!0}),_(B)!=="svelte-tww4as"&&(B.textContent=Ye),me=o(e),c(F.$$.fragment,e),de=o(e),Z=r(e,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-1jzflbu"&&(Z.textContent=ze),_e=o(e),c(E.$$.fragment,e),be=o(e),X=r(e,"P",{"data-svelte-h":!0}),_(X)!=="svelte-sqe3e6"&&(X.innerHTML=Ke),$e=o(e),c(G.$$.fragment,e),Me=o(e),c(H.$$.fragment,e),je=o(e),c(C.$$.fragment,e),ye=o(e),c(V.$$.fragment,e),Ae=o(e),b=r(e,"DIV",{class:!0});var j=z(b);c(q.$$.fragment,j),Xe=o(j),te=r(j,"P",{"data-svelte-h":!0}),_(te)!=="svelte-m9n3hj"&&(te.textContent=et),Ge=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),Ve=o(j),c(k.$$.fragment,j),j.forEach(n),ve=o(e),c(P.$$.fragment,e),Ie=o(e),$=r(e,"DIV",{class:!0});var y=z($);c(W.$$.fragment,y),qe=o(y),se=r(y,"P",{"data-svelte-h":!0}),_(se)!=="svelte-ke8nih"&&(se.innerHTML=at),Pe=o(y),oe=r(y,"P",{"data-svelte-h":!0}),_(oe)!=="svelte-4ig96s"&&(oe.innerHTML=st),We=o(y),ie=r(y,"P",{"data-svelte-h":!0}),_(ie)!=="svelte-1ux1b45"&&(ie.innerHTML=ot),Re=o(y),re=r(y,"P",{"data-svelte-h":!0}),_(re)!=="svelte-clgwg2"&&(re.innerHTML=it),y.forEach(n),Oe=o(e),c(R.$$.fragment,e),xe=o(e),x=r(e,"DIV",{class:!0});var Fe=z(x);c(L.$$.fragment,Fe),Le=o(Fe),le=r(Fe,"P",{"data-svelte-h":!0}),_(le)!=="svelte-ur89v"&&(le.textContent=rt),Fe.forEach(n),we=o(e),c(N.$$.fragment,e),Te=o(e),w=r(e,"DIV",{class:!0});var Ze=z(w);c(Q.$$.fragment,Ze),Ne=o(Ze),ge=r(Ze,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-1lrcldb"&&(ge.textContent=lt),Ze.forEach(n),Ue=o(e),c(S.$$.fragment,e),Ce=o(e),T=r(e,"DIV",{class:!0});var Ee=z(T);c(D.$$.fragment,Ee),Qe=o(Ee),ue=r(Ee,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-1ysqsmg"&&(ue.textContent=gt),Ee.forEach(n),ke=o(e),c(Y.$$.fragment,e),Je=o(e),he=r(e,"P",{}),z(he).forEach(n),this.h()},h(){K(l,"name","hf:doc:metadata"),K(l,"content",It),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(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(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(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,A,t),a(e,v,t),p(I,e,t),a(e,u,t),a(e,O,t),a(e,pe,t),a(e,J,t),a(e,fe,t),a(e,B,t),a(e,me,t),p(F,e,t),a(e,de,t),a(e,Z,t),a(e,_e,t),p(E,e,t),a(e,be,t),a(e,X,t),a(e,$e,t),p(G,e,t),a(e,Me,t),p(H,e,t),a(e,je,t),p(C,e,t),a(e,ye,t),p(V,e,t),a(e,Ae,t),a(e,b,t),p(q,b,null),g(b,Xe),g(b,te),g(b,Ge),g(b,ne),g(b,He),g(b,ae),g(b,Ve),p(k,b,null),a(e,ve,t),p(P,e,t),a(e,Ie,t),a(e,$,t),p(W,$,null),g($,qe),g($,se),g($,Pe),g($,oe),g($,We),g($,ie),g($,Re),g($,re),a(e,Oe,t),p(R,e,t),a(e,xe,t),a(e,x,t),p(L,x,null),g(x,Le),g(x,le),a(e,we,t),p(N,e,t),a(e,Te,t),a(e,w,t),p(Q,w,null),g(w,Ne),g(w,ge),a(e,Ue,t),p(S,e,t),a(e,Ce,t),a(e,T,t),p(D,T,null),g(T,Qe),g(T,ue),a(e,ke,t),p(Y,e,t),a(e,Je,t),a(e,he,t),Be=!0},p(e,[t]){const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),C.$set(j);const y={};t&2&&(y.$$scope={dirty:t,ctx:e}),k.$set(y)},i(e){Be||(f(I.$$.fragment,e),f(F.$$.fragment,e),f(E.$$.fragment,e),f(G.$$.fragment,e),f(H.$$.fragment,e),f(C.$$.fragment,e),f(V.$$.fragment,e),f(q.$$.fragment,e),f(k.$$.fragment,e),f(P.$$.fragment,e),f(W.$$.fragment,e),f(R.$$.fragment,e),f(L.$$.fragment,e),f(N.$$.fragment,e),f(Q.$$.fragment,e),f(S.$$.fragment,e),f(D.$$.fragment,e),f(Y.$$.fragment,e),Be=!0)},o(e){m(I.$$.fragment,e),m(F.$$.fragment,e),m(E.$$.fragment,e),m(G.$$.fragment,e),m(H.$$.fragment,e),m(C.$$.fragment,e),m(V.$$.fragment,e),m(q.$$.fragment,e),m(k.$$.fragment,e),m(P.$$.fragment,e),m(W.$$.fragment,e),m(R.$$.fragment,e),m(L.$$.fragment,e),m(N.$$.fragment,e),m(Q.$$.fragment,e),m(S.$$.fragment,e),m(D.$$.fragment,e),m(Y.$$.fragment,e),Be=!1},d(e){e&&(n(M),n(A),n(v),n(u),n(O),n(pe),n(J),n(fe),n(B),n(me),n(de),n(Z),n(_e),n(be),n(X),n($e),n(Me),n(je),n(ye),n(Ae),n(b),n(ve),n(Ie),n($),n(Oe),n(xe),n(x),n(we),n(Te),n(w),n(Ue),n(Ce),n(T),n(ke),n(Je),n(he)),n(l),d(I,e),d(F,e),d(E,e),d(G,e),d(H,e),d(C,e),d(V,e),d(q),d(k),d(P,e),d(W),d(R,e),d(L),d(N,e),d(Q),d(S,e),d(D),d(Y,e)}}}const It='{"title":"OAuth and FastAPI","local":"oauth-and-fastapi","sections":[],"depth":1}';function Ot(ee){return ct(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bt extends ft{constructor(l){super(),mt(this,l,Ot,vt,ht,{})}}export{Bt as component};
