signin
畫面 用組件砌出嚟嘅完整畫面。由其中一個開始做你自己嘅。
登入畫面經歷嘅每個狀態:問地址、返嚟、寄咗連結之後、出咗錯嗰陣,同埋其他入嚟嘅方法。
每個例子都真係用得,不過入面啲連結唔會帶你去邊度。 HTML 顯示可以複製嘅標記。
問地址
一個欄位同一個掣。冇嘢要記,亦冇嘢畀人偷。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >電郵</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autofocus autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >繼續</button >
</form >
<p rst-signin-or >or</p >
<div rst-signin-passkey ="after" >
<button rst-btn ="block" type ="button" aria-describedby ="rst-signin-passkey-msg" >用通行密鑰登入</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" ></p >
<button type ="button" rst-signin-passkey-close hidden aria-label ="關閉" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
</div >
</section >
喺應用程式入面,呢個會去到 /signin。喺呢度,佢嘅連結同表格都唔會去任何地方。
用 Keymail 返嚟
畀返嚟嘅人:上次用過嘅地址寫咗喺個掣上面,撳一下就寄出。記住個地址,同埋再檢查一次,係你個應用程式嘅事。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<input type ="hidden" name ="address" value ="kay@example.org" >
<input type ="hidden" name ="expect" value ="keymail" >
<button rst-btn ="primary block" type ="submit" autofocus >
<span >以 <bdi >kay@example.org</bdi > 身份繼續</span >
</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >用第二個電郵</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin, /signin/forget。喺呢度,佢嘅連結同表格都唔會去任何地方。
用電郵連結返嚟
地址就喺個掣上面,所以乜都唔使打。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<input type ="hidden" name ="address" value ="grace@example.com" >
<button rst-btn ="primary block" type ="submit" autofocus >
<span >以 <bdi >grace@example.com</bdi > 身份繼續</span >
</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >用第二個電郵</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin, /signin/forget。喺呢度,佢嘅連結同表格都唔會去任何地方。
通行密鑰
對已經有嘅人嚟講係最快,亦冇嘢要打。但都要俾多一個方法:人會唔見咗部機,而一條用唔到嘅通行密鑰就係一道鎖死咗嘅門。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<div rst-signin-passkey ="before" >
<button rst-btn ="primary block" type ="button" aria-describedby ="rst-signin-passkey-msg" >用你嘅通行密鑰登入</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" ></p >
<button type ="button" rst-signin-passkey-close hidden aria-label ="關閉" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
<p rst-signin-or >or</p >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >電郵</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >繼續</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >用第二個電郵</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin, /signin/forget。喺呢度,佢嘅連結同表格都唔會去任何地方。
通行密鑰,冇用到嘅時候
呢度電郵表單喺個掣後面,所以訊息喺個掣上面、蓋住標題咁打開,永遠唔會遮住電郵欄。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<div rst-signin-passkey ="before" >
<button rst-btn ="primary block" type ="button" aria-describedby ="rst-signin-passkey-msg" >用你嘅通行密鑰登入</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" >冇用到通行密鑰。請再試一次,或者用你個電郵。</p >
<button type ="button" rst-signin-passkey-close aria-label ="關閉" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
<p rst-signin-or >or</p >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >電郵</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >繼續</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >用第二個電郵</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin, /signin/forget。喺呢度,佢嘅連結同表格都唔會去任何地方。
寄咗連結之後
將個地址原樣顯示返。喺等一封永遠唔會嚟嘅電郵之前,呢個係唯一發現打錯字嘅機會。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >睇下你嘅電郵</h1 >
<p >我哋已經寄咗條連結去 <bdi >grace@example.com</bdi >。條連結只可以用一次,而且好快會過期。</p >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >用第二個電郵</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin/forget。喺呢度,佢嘅連結同表格都唔會去任何地方。
寄咗連結之後,喺另一個瀏覽器
如果個地址唔係呢個瀏覽器送出嘅,頁面就唔會估佢。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >睇下你嘅電郵</h1 >
<p >我哋已經寄咗條連結去你嘅收件匣。條連結只可以用一次,而且好快會過期。</p >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >用第二個電郵</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin/forget。喺呢度,佢嘅連結同表格都唔會去任何地方。
提供嘅係 Keymail,寄出去嘅卻係連結
用一句話講今次寄咗連結,唔會估原因。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >睇下你嘅電郵</h1 >
<p >今次我哋寄咗條登入連結俾你。</p >
<p >我哋已經寄咗條連結去 <bdi >kay@example.org</bdi >。條連結只可以用一次,而且好快會過期。</p >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >用第二個電郵</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin/forget。喺呢度,佢嘅連結同表格都唔會去任何地方。
去緊 Keymail
送人去登入期間嘅等候頁。你個應用程式會自己將頁面推前;連結係防佢冇推前而設嘅。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >而家幫你登入</h1 >
<p >而家帶你確認係你本人。</p >
<a rst-btn ="primary block" href ="#" >繼續</a >
</div >
</section >
睇落唔啱嘅地址
個提示屬於嗰個欄位,焦點亦都由嗰度開始。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >電郵</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" value ="grace@example" required autofocus autocomplete ="email" aria-invalid ="true" aria-describedby ="rst-signin-email-error" >
<p rst-field-error id ="rst-signin-email-error" >呢個唔似係電郵地址。</p >
</div >
<button rst-btn ="primary block" type ="submit" >繼續</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin。喺呢度,佢嘅連結同表格都唔會去任何地方。
Keymail 確認唔到嘅時候
個掣會轉做改為寄連結,咁就冇人會卡住。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<div rst-callout id ="rst-signin-problem" rst-tone ="negative" tabindex ="-1" autofocus >
<span rst-callout-ic aria-hidden ="true" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="12" cy ="12" r ="10" /><path d ="m15 9-6 6" /><path d ="m9 9 6 6" /></svg >
</span >
<div rst-callout-body >
<p >我哋確認唔到係你本人。請再試一次,或者寄一條登入連結俾自己。</p >
</div >
</div >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >電郵</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" value ="kay@example.org" required autocomplete ="email" >
</div >
<input type ="hidden" name ="force" value ="1" >
<button rst-btn ="primary block" type ="submit" >改為寄條連結俾我</button >
</form >
</div >
</section >
喺應用程式入面,呢個會去到 /signin。喺呢度,佢嘅連結同表格都唔會去任何地方。
冇用到通行密鑰嘅時候
訊息喺通行密鑰個掣下面打開,唔會佔任何位,所以「繼續」會留喺原位。你嘅腳本負責寫訊息同顯示關閉掣。喺窄身手機上,個提示喺關閉之前可能會遮住頁尾嘅連結。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >電郵</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autofocus autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >繼續</button >
</form >
<p rst-signin-or >or</p >
<div rst-signin-passkey ="after" >
<button rst-btn ="block" type ="button" aria-describedby ="rst-signin-passkey-msg" >用通行密鑰登入</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" >冇用到通行密鑰。請再試一次,或者用你個電郵。</p >
<button type ="button" rst-signin-passkey-close aria-label ="關閉" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
</div >
</section >
喺應用程式入面,呢個會去到 /signin。喺呢度,佢嘅連結同表格都唔會去任何地方。
Google、Apple 同其他
我哋俾按鈕你,按每間公司嘅要求畫好。登入本身我哋唔提供:嗰部分你自己接去所用嘅供應商。
<section rst-box >
<h1 >登入</h1 >
<div rst-signin-providers >
<form method ="post" action ="/auth/google" >
<button rst-btn ="block" type ="submit" >
<svg aria-hidden ="true" focusable ="false" width ="1.1em" height ="1.1em" viewBox ="0 0 48 48" ><path fill ="#EA4335" d ="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" /><path fill ="#4285F4" d ="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" /><path fill ="#FBBC05" d ="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" /><path fill ="#34A853" d ="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" /></svg >
用 Google 繼續
</button >
</form >
<form method ="post" action ="/auth/apple" >
<button rst-btn ="block" type ="submit" >
<svg aria-hidden ="true" focusable ="false" width ="1.1em" height ="1.1em" viewBox ="0 0 24 24" ><path fill ="currentColor" d ="M12.15 6.9c-.95 0-2.42-1.08-3.96-1.04-2.04.03-3.91 1.18-4.96 3.01-2.12 3.68-.55 9.1 1.52 12.09 1.01 1.45 2.2 3.09 3.79 3.04 1.52-.07 2.09-.99 3.94-.99 1.83 0 2.35.99 3.96.95 1.64-.03 2.68-1.48 3.68-2.95 1.15-1.69 1.63-3.33 1.66-3.42-.04-.01-3.18-1.22-3.22-4.86-.03-3.04 2.48-4.49 2.6-4.56-1.43-2.09-3.63-2.32-4.39-2.38-2-.15-3.68 1.09-4.62 1.09zm3.38-3.07c.84-1.01 1.4-2.43 1.25-3.83-1.21.05-2.66.8-3.53 1.82-.78.9-1.46 2.34-1.27 3.71 1.34.1 2.71-.69 3.55-1.7z" /></svg >
用 Apple 繼續
</button >
</form >
<a href ="/signin" >改用電郵</a >
</div >
</section >
喺應用程式入面,呢個會去到 /auth/apple, /auth/google, /signin。喺呢度,佢嘅連結同表格都唔會去任何地方。
電郵同密碼
如果你真係要用密碼,就照用同一個「一個主入口」嘅版面,並且將重設嘅入口擺喺個掣正下面,唔好收埋。
人哋會重用密碼,密碼會外洩,而安全咁儲存佢哋嘅責任就落咗喺你度。用電郵入面嘅連結加通行密鑰,或者淨係用通行密鑰。標記擺喺度,係因為有啲產品仲需要佢。
<section rst-box >
<h1 >登入</h1 >
<form rst-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="pw-email" >電郵</label >
<input rst-input id ="pw-email" name ="email" type ="email" autocomplete ="email" required >
</div >
<div rst-field >
<label rst-field-label for ="pw-pass" >密碼</label >
<input rst-input id ="pw-pass" name ="password" type ="password" autocomplete ="current-password" required >
</div >
<button rst-btn ="primary" type ="submit" >繼續</button >
</form >
</section >
喺應用程式入面,呢個會去到 /signin。喺呢度,佢嘅連結同表格都唔會去任何地方。
一個入口
一個掣,畀呢個人上次用過嘅入口,或者你個 app 首先提供嘅入口。其他所有方法都喺「其他登入方法」後面,㩒一下就到。呢度每個掣都係藥丸形。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door ="one-way" >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<a rst-btn ="primary block" href ="/signin/oficina" >
<svg viewBox ="18 20 62 60" aria-hidden ="true" focusable ="false" ><rect x ="30.62" y ="23.78" width ="45.60" height ="36.48" rx ="7.98" fill ="currentColor" opacity =".55" /><rect x ="22.64" y ="36.32" width ="50.16" height ="38.76" rx ="7.98" fill ="currentColor" /></svg >
<span >用 Oficina ID 繼續</span >
</a >
<a rst-btn ="ghost" href ="/signin?ways=1&way=oficina" >
<span >其他登入方法</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
</div >
</section >
喺應用程式入面,呢個會去到 /signin/oficina, /signin?ways=1&way=oficina。喺呢度,佢嘅連結同表格都唔會去任何地方。
一個入口:通行密鑰
用通行密鑰做唯一嘅入口。個掣先畫成停用,等腳本去啟用佢,咁啟用嗰陣乜都唔會郁;下面嗰行就係腳本講發生咗乜嘢嘅地方。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door ="one-way" >
<h1 id ="rst-signin-heading" >登入 Harbour</h1 >
<div rst-signin-passkey ="before" >
<button rst-btn ="primary block" type ="button" aria-describedby ="rst-signin-passkey-msg" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" /><circle cx ="16.5" cy ="7.5" r =".5" fill ="currentColor" /></svg >
<span >用你嘅通行密鑰登入</span >
</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" ></p >
<button type ="button" rst-signin-passkey-close hidden aria-label ="關閉" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
<a rst-btn ="ghost" href ="/signin?ways=1&way=passkey" >
<span >其他登入方法</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
</div >
</section >
喺應用程式入面,呢個會去到 /signin?ways=1&way=passkey。喺呢度,佢嘅連結同表格都唔會去任何地方。
其他登入方法
一列連結,唔係表單,所以唔使腳本。每一行都會打開一個只有一個入口嘅畫面,而電郵嗰行會顯示呢個瀏覽器記住嘅地址。
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >泊位同碼頭位,一分鐘訂好。</p >
</div >
<div rst-signin-door ="one-way" >
<h1 id ="rst-signin-heading" >其他登入方法</h1 >
<div rst-signin-ways >
<a rst-btn ="block" href ="/signin?way=email" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><rect width ="20" height ="16" x ="2" y ="4" rx ="2" /><path d ="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" /></svg >
<span >電郵 <bdi >ada@example.com</bdi ></span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
<a rst-btn ="block" href ="/signin?way=passkey" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" /><circle cx ="16.5" cy ="7.5" r =".5" fill ="currentColor" /></svg >
<span >用通行密鑰登入</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
<form rst-signin-form method ="post" action ="/signin/forget" >
<input type ="hidden" name ="way" value ="email" >
<button rst-btn ="block" type ="submit" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><circle cx ="12" cy ="12" r ="4" /><path d ="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8" /></svg >
<span >用第二個電郵</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</button >
</form >
</div >
<a rst-btn ="ghost" href ="/signin?way=oficina" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m15 18-6-6 6-6" /></svg >
<span >返回</span >
</a >
</div >
</section >
喺應用程式入面,呢個會去到 /signin/forget, /signin?way=email, /signin?way=oficina, /signin?way=passkey。喺呢度,佢嘅連結同表格都唔會去任何地方。