登出
類似於登入按鈕,登出按鈕的存在與否取決於 amp-access
元件的狀態
<button amp-access="loggedIn" amp-access-hide tabindex="0" on="tap:amp-access.login-sign-out" class="button-primary comment-button">Logout</button>
當您點擊「登出」按鈕時,您會被導向到您在 amp-access
JSON 設定中指定的 URL,作為登入物件的一部分
{ "login": { "sign-in": "https://ampbyexample.com/samples_templates/comment_section/login?rid=READER_ID&url=CANONICAL_URL", "sign-out": "https://ampbyexample.com/samples_templates/comment_section/logout" } }
類似於登入,當 AMPByExample 伺服器收到登出請求時,它會使用 AMP 函式庫自動新增的回傳 URL 查詢參數並重新導向至該 URL,並加入 #success=true
。此時,您會回到初始頁面;先前為登入頁面建立的 AMPByExample Cookie (名為 ABE_LOGGED_IN
) 將在此時清除。