Discover books, shows, and movies at your level. Track your progress by filling your Shelf with what you find, and share with other language learners. *No dusting required. shlf.space
at master 50 lines 1.4 kB view raw
1package login 2 3import "shlf.space/internal/layouts/base" 4 5templ LoginPage(params LoginPageParams) { 6 @layouts.Base(layouts.BaseParams{Title: "login"}) { 7 <div class="container"> 8 <form class="group flex flex-col gap-2" hx-post="/login" hx-swap="none" hx-disabled-elt="#login-button"> 9 <label> 10 <span>Handle</span> 11 <input 12 class="input" 13 id="handle" 14 name="handle" 15 type="text" 16 placeholder="username.bsky.social" 17 autocapitalize="none" 18 autocorrect="off" 19 autocomplete="username" 20 required 21 tabindex="1" 22 /> 23 </label> 24 <input type="hidden" name="return_url" value={ params.ReturnUrl }/> 25 <button type="submit" id="login-button" tabindex="2" class="button self-end"> 26 <i class="w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" data-lucide="loader-circle"></i> 27 <span>Login</span> 28 </button> 29 </form> 30 <div data-field="error" class="text-red-500"> 31 if params.ErrorCode != "" { 32 <p class="error"> 33 switch (params.ErrorCode) { 34 case "access_denied": 35 You have not authorized the app. 36 case "session": 37 Server failed to create user session. 38 case "handle": 39 Server failed to validate your handle. 40 default: 41 Internal Server error. 42 } 43 Please try again. 44 </p> 45 } 46 <p id="login-msg"></p> 47 </div> 48 </div> 49 } 50}