[{"data":1,"prerenderedAt":672},["ShallowReactive",2],{"navigation_docs":3,"-guides-sign-out":189,"-guides-sign-out-surround":667},[4,30,65,105,120,135,164,184],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting started",false,"/getting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-book-open",{"title":16,"path":17,"stem":18,"icon":19},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-rocket",{"title":26,"path":27,"stem":28,"icon":29},"Session Lab","/getting-started/session-lab","1.getting-started/4.session-lab","i-lucide-flask-conical",{"title":31,"icon":6,"path":32,"stem":33,"children":34,"page":6},"Concepts","/concepts","2.concepts",[35,40,45,50,55,60],{"title":36,"path":37,"stem":38,"icon":39},"How it works","/concepts/how-it-works","2.concepts/1.how-it-works","i-lucide-workflow",{"title":41,"path":42,"stem":43,"icon":44},"Sessions and tokens","/concepts/sessions-and-tokens","2.concepts/2.sessions-and-tokens","i-lucide-key-round",{"title":46,"path":47,"stem":48,"icon":49},"State and events","/concepts/state-and-events","2.concepts/3.state-and-events","i-lucide-radio",{"title":51,"path":52,"stem":53,"icon":54},"Token refresh","/concepts/token-refresh","2.concepts/4.token-refresh","i-lucide-refresh-cw",{"title":56,"path":57,"stem":58,"icon":59},"Storage","/concepts/storage","2.concepts/5.storage","i-lucide-hard-drive",{"title":61,"path":62,"stem":63,"icon":64},"Guarantees","/concepts/guarantees","2.concepts/6.guarantees","i-lucide-shield-check",{"title":66,"icon":6,"path":67,"stem":68,"children":69,"page":6},"Providers","/providers","3.providers",[70,75,80,85,90,95,100],{"title":71,"path":72,"stem":73,"icon":74},"Choosing a provider","/providers/choosing","3.providers/1.choosing","i-lucide-signpost",{"title":76,"path":77,"stem":78,"icon":79},"Credentials","/providers/credentials","3.providers/2.credentials","i-lucide-user-round-key",{"title":81,"path":82,"stem":83,"icon":84},"OAuth 2.0 and OpenID Connect","/providers/oauth2","3.providers/3.oauth2","i-lucide-shield",{"title":86,"path":87,"stem":88,"icon":89},"OAuth through your backend","/providers/backend-oauth","3.providers/4.backend-oauth","i-lucide-server",{"title":91,"path":92,"stem":93,"icon":94},"Google","/providers/google","3.providers/5.google","i-simple-icons-google",{"title":96,"path":97,"stem":98,"icon":99},"Apple","/providers/apple","3.providers/6.apple","i-simple-icons-apple",{"title":101,"path":102,"stem":103,"icon":104},"Custom providers","/providers/custom","3.providers/7.custom","i-lucide-puzzle",{"title":106,"icon":6,"path":107,"stem":108,"children":109,"page":6},"Flutter","/flutter","4.flutter",[110,115],{"title":111,"path":112,"stem":113,"icon":114},"Widgets","/flutter/widgets","4.flutter/1.widgets","i-lucide-layout-template",{"title":116,"path":117,"stem":118,"icon":119},"Routing","/flutter/routing","4.flutter/2.routing","i-lucide-route",{"title":121,"icon":6,"path":122,"stem":123,"children":124,"page":6},"HTTP","/http","5.http",[125,130],{"title":126,"path":127,"stem":128,"icon":129},"Dio","/http/dio","5.http/1.dio","i-lucide-arrow-left-right",{"title":131,"path":132,"stem":133,"icon":134},"Other HTTP clients","/http/other-clients","5.http/2.other-clients","i-lucide-plug-zap",{"title":136,"icon":6,"path":137,"stem":138,"children":139,"page":6},"Guides","/guides","6.guides",[140,145,150,155,159],{"title":141,"path":142,"stem":143,"icon":144},"Multiple accounts","/guides/multi-account","6.guides/1.multi-account","i-lucide-users",{"title":146,"path":147,"stem":148,"icon":149},"Sign-out and revocation","/guides/sign-out","6.guides/2.sign-out","i-lucide-log-out",{"title":151,"path":152,"stem":153,"icon":154},"Access policy","/guides/access-policy","6.guides/3.access-policy","i-lucide-shield-alert",{"title":156,"path":157,"stem":158,"icon":29},"Testing","/guides/testing","6.guides/4.testing",{"title":160,"path":161,"stem":162,"icon":163},"Backend requirements","/guides/backend-requirements","6.guides/5.backend-requirements","i-lucide-server-cog",{"title":165,"icon":6,"path":166,"stem":167,"children":168,"page":6},"Reference","/reference","7.reference",[169,174,179],{"title":170,"path":171,"stem":172,"icon":173},"API reference","/reference/api","7.reference/1.api","i-lucide-library",{"title":175,"path":176,"stem":177,"icon":178},"FAQ","/reference/faq","7.reference/2.faq","i-lucide-message-circle-question",{"title":180,"path":181,"stem":182,"icon":183},"Troubleshooting","/reference/troubleshooting","7.reference/3.troubleshooting","i-lucide-wrench",{"title":185,"path":186,"stem":187,"icon":188},"Changelog","/changelog","changelog","i-lucide-history",{"id":190,"title":146,"body":191,"description":660,"extension":661,"links":662,"meta":663,"navigation":664,"path":147,"seo":665,"stem":148,"__hash__":666},"docs/6.guides/2.sign-out.md",{"type":192,"value":193,"toc":654},"minimark",[194,199,236,240,265,268,277,281,291,294,379,393,397,400,580,597,601,650],[195,196,198],"h2",{"id":197},"signing-out","Signing out",[200,201,206],"pre",{"className":202,"code":203,"language":204,"meta":205,"style":205},"language-dart shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","await authyra.signOut();\n","dart","",[207,208,209],"code",{"__ignoreMap":205},[210,211,214,218,222,226,230,233],"span",{"class":212,"line":213},"line",1,[210,215,217],{"class":216},"s7zQu","await",[210,219,221],{"class":220},"sTEyZ"," authyra",[210,223,225],{"class":224},"sMK4o",".",[210,227,229],{"class":228},"s2Zo4","signOut",[210,231,232],{"class":220},"()",[210,234,235],{"class":224},";\n",[237,238,239],"p",{},"In order:",[241,242,243,247,250,256,259],"ol",{},[244,245,246],"li",{},"New refreshes of the session are blocked.",[244,248,249],{},"A refresh already in flight is awaited, up to 10 seconds, so the newest tokens are the ones revoked.",[244,251,252,253,255],{},"The provider's ",[207,254,229],{}," revokes the session server-side. If that call fails (offline, server error), the failure is logged and the sign-out continues.",[244,257,258],{},"The session is removed from storage, then from memory.",[244,260,261,264],{},[207,262,263],{},"SessionEndedEvent(reason: signedOut)"," is emitted, and the state changes.",[237,266,267],{},"If the same user signs in again while step 3 is still running, the new session is kept: the late sign-out does not remove it.",[237,269,270,272,273,276],{},[207,271,229],{}," never asks your ",[207,274,275],{},"AuthPolicy",": a user can always sign out.",[195,278,280],{"id":279},"when-the-server-ends-the-session","When the server ends the session",[237,282,283,284,287,288,225],{},"A session ends without the user asking when its refresh token is rejected: revoked by an admin, a password change, reuse detection, or simply expired. Authyra emits ",[207,285,286],{},"SessionEndedEvent(reason: revoked)"," and the state moves to the next account or to ",[207,289,290],{},"AuthSignedOut",[237,292,293],{},"Tell the user why:",[200,295,297],{"className":202,"code":296,"language":204,"meta":205,"style":205},"authyra.events.listen((event) {\n  if (event case SessionEndedEvent(reason: SessionEndReason.revoked)) {\n    showBanner('You were signed out. Please sign in again.');\n  }\n});\n",[207,298,299,317,347,365,371],{"__ignoreMap":205},[210,300,301,304,306,309,311,314],{"class":212,"line":213},[210,302,303],{"class":220},"authyra",[210,305,225],{"class":224},[210,307,308],{"class":220},"events",[210,310,225],{"class":224},[210,312,313],{"class":228},"listen",[210,315,316],{"class":220},"((event) {\n",[210,318,320,323,326,329,333,336,339,342,344],{"class":212,"line":319},2,[210,321,322],{"class":216},"  if",[210,324,325],{"class":220}," (event ",[210,327,328],{"class":216},"case",[210,330,332],{"class":331},"sBMFI"," SessionEndedEvent",[210,334,335],{"class":220},"(reason",[210,337,338],{"class":224},":",[210,340,341],{"class":331}," SessionEndReason",[210,343,225],{"class":224},[210,345,346],{"class":220},"revoked)) {\n",[210,348,350,353,356,360,363],{"class":212,"line":349},3,[210,351,352],{"class":228},"    showBanner",[210,354,355],{"class":220},"(",[210,357,359],{"class":358},"sfazB","'You were signed out. Please sign in again.'",[210,361,362],{"class":220},")",[210,364,235],{"class":224},[210,366,368],{"class":212,"line":367},4,[210,369,370],{"class":220},"  }\n",[210,372,374,377],{"class":212,"line":373},5,[210,375,376],{"class":220},"})",[210,378,235],{"class":224},[237,380,381,382,385,386,389,390,225],{},"A session also ends with ",[207,383,384],{},"SessionEndReason.expired"," when it can no longer be renewed: its access token expired and it has no usable refresh token. This is detected at startup, on a scheduled check, on ",[207,387,388],{},"accessToken()"," or on ",[207,391,392],{},"switchTo",[195,394,396],{"id":395},"revoking-on-your-backend","Revoking on your backend",[237,398,399],{},"Implement the provider's sign-out so a stolen refresh token stops working:",[200,401,403],{"className":202,"code":402,"language":204,"meta":205,"style":205},"CredentialsProvider(\n  id: 'api',\n  signIn: loginWithApi,\n  refresh: refreshWithApi,\n  signOut: (session) async {\n    final refreshToken = session.tokens?.refreshToken;\n    if (refreshToken != null) {\n      await authApi.post\u003Cvoid>('/auth/sign-out', data: {'refresh_token': refreshToken});\n    }\n  },\n)\n",[207,404,405,413,426,438,450,466,495,513,560,566,574],{"__ignoreMap":205},[210,406,407,410],{"class":212,"line":213},[210,408,409],{"class":331},"CredentialsProvider",[210,411,412],{"class":220},"(\n",[210,414,415,418,420,423],{"class":212,"line":319},[210,416,417],{"class":220},"  id",[210,419,338],{"class":224},[210,421,422],{"class":358}," 'api'",[210,424,425],{"class":224},",\n",[210,427,428,431,433,436],{"class":212,"line":349},[210,429,430],{"class":220},"  signIn",[210,432,338],{"class":224},[210,434,435],{"class":220}," loginWithApi",[210,437,425],{"class":224},[210,439,440,443,445,448],{"class":212,"line":367},[210,441,442],{"class":220},"  refresh",[210,444,338],{"class":224},[210,446,447],{"class":220}," refreshWithApi",[210,449,425],{"class":224},[210,451,452,455,457,460,463],{"class":212,"line":373},[210,453,454],{"class":220},"  signOut",[210,456,338],{"class":224},[210,458,459],{"class":220}," (session) ",[210,461,462],{"class":216},"async",[210,464,465],{"class":220}," {\n",[210,467,469,473,476,479,482,484,487,490,493],{"class":212,"line":468},6,[210,470,472],{"class":471},"spNyl","    final",[210,474,475],{"class":220}," refreshToken ",[210,477,478],{"class":224},"=",[210,480,481],{"class":220}," session",[210,483,225],{"class":224},[210,485,486],{"class":220},"tokens",[210,488,489],{"class":224},"?.",[210,491,492],{"class":220},"refreshToken",[210,494,235],{"class":224},[210,496,498,501,504,507,510],{"class":212,"line":497},7,[210,499,500],{"class":216},"    if",[210,502,503],{"class":220}," (refreshToken ",[210,505,506],{"class":224},"!=",[210,508,509],{"class":224}," null",[210,511,512],{"class":220},") {\n",[210,514,516,519,522,524,527,530,533,536,539,542,545,547,550,553,555,558],{"class":212,"line":515},8,[210,517,518],{"class":216},"      await",[210,520,521],{"class":220}," authApi",[210,523,225],{"class":224},[210,525,526],{"class":228},"post",[210,528,529],{"class":220},"\u003C",[210,531,532],{"class":471},"void",[210,534,535],{"class":220},">(",[210,537,538],{"class":358},"'/auth/sign-out'",[210,540,541],{"class":224},",",[210,543,544],{"class":220}," data",[210,546,338],{"class":224},[210,548,549],{"class":220}," {",[210,551,552],{"class":358},"'refresh_token'",[210,554,338],{"class":224},[210,556,557],{"class":220}," refreshToken})",[210,559,235],{"class":224},[210,561,563],{"class":212,"line":562},9,[210,564,565],{"class":220},"    }\n",[210,567,569,572],{"class":212,"line":568},10,[210,570,571],{"class":220},"  }",[210,573,425],{"class":224},[210,575,577],{"class":212,"line":576},11,[210,578,579],{"class":220},")\n",[237,581,582,585,586,589,590,593,594,225],{},[207,583,584],{},"OAuth2Provider"," calls the server's revocation endpoint when ",[207,587,588],{},"revocationEndpoint"," is set; ",[207,591,592],{},"BackendOAuthProvider"," posts to ",[207,595,596],{},"signOutEndpoint",[195,598,600],{"id":599},"wiping-everything","Wiping everything",[200,602,604],{"className":202,"code":603,"language":204,"meta":205,"style":205},"await authyra.signOutAll();          // At runtime: revokes and removes every session.\nawait const SecureAuthStorage().deleteAll(); // Before start(): removes Authyra's keys only.\n",[207,605,606,626],{"__ignoreMap":205},[210,607,608,610,612,614,617,619,622],{"class":212,"line":213},[210,609,217],{"class":216},[210,611,221],{"class":220},[210,613,225],{"class":224},[210,615,616],{"class":228},"signOutAll",[210,618,232],{"class":220},[210,620,621],{"class":224},";",[210,623,625],{"class":624},"sHwdD","          // At runtime: revokes and removes every session.\n",[210,627,628,630,633,636,638,640,643,645,647],{"class":212,"line":319},[210,629,217],{"class":216},[210,631,632],{"class":471}," const",[210,634,635],{"class":331}," SecureAuthStorage",[210,637,232],{"class":220},[210,639,225],{"class":224},[210,641,642],{"class":228},"deleteAll",[210,644,232],{"class":220},[210,646,621],{"class":224},[210,648,649],{"class":624}," // Before start(): removes Authyra's keys only.\n",[651,652,653],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":205,"searchDepth":319,"depth":319,"links":655},[656,657,658,659],{"id":197,"depth":319,"text":198},{"id":279,"depth":319,"text":280},{"id":395,"depth":319,"text":396},{"id":599,"depth":319,"text":600},"What happens when the user signs out, and when the server ends a session.","md",null,{},{"icon":149},{"title":146,"description":660},"xjNV31IRwDVNgmRf4mLuuvH43T8m5G-Uuv1x8_nhldA",[668,670],{"title":141,"path":142,"stem":143,"description":669,"icon":144,"children":-1},"Several signed-in accounts on one device, one active at a time.",{"title":151,"path":152,"stem":153,"description":671,"icon":154,"children":-1},"Refuse a sign-in or an account switch before it happens.",1794303130387]