Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol diffdown.com

feat: replace OAuth buttons with Bluesky handle login form

+35 -32
+1 -1
cmd/server/main.go
··· 42 42 } 43 43 44 44 pages := []string{ 45 - "dashboard", "diff", "editor", "file_view", "history", 45 + "atproto_login", "dashboard", "diff", "editor", "file_view", "history", 46 46 "landing", "login", "new_repo", "register", "repo", 47 47 } 48 48 tmpls := make(map[string]*template.Template, len(pages))
+17
templates/atproto_login.html
··· 1 + {{template "base" .}} 2 + {{define "content"}} 3 + <div class="auth-page"> 4 + <h2>Sign in with Bluesky</h2> 5 + {{if .Error}} 6 + <div class="alert alert-error">{{.Error}}</div> 7 + {{end}} 8 + <form method="post" action="/auth/atproto" class="auth-form"> 9 + <label>Bluesky handle 10 + <input type="text" name="handle" placeholder="alice.bsky.social" required autofocus 11 + autocomplete="username" spellcheck="false" autocorrect="off" autocapitalize="off"> 12 + </label> 13 + <button type="submit" class="btn">Continue</button> 14 + </form> 15 + <p class="auth-switch">Don't have a Bluesky account? <a href="https://bsky.app" target="_blank" rel="noopener">Create one at bsky.app</a></p> 16 + </div> 17 + {{end}}
+10 -14
templates/login.html
··· 1 1 {{template "base" .}} 2 2 {{define "content"}} 3 3 <div class="auth-page"> 4 - <h2>Log In</h2> 5 - <form method="post" action="/auth/login" class="auth-form"> 6 - <label>Email 7 - <input type="email" name="email" required autofocus> 8 - </label> 9 - <label>Password 10 - <input type="password" name="password" required> 4 + <h2>Sign in with Bluesky</h2> 5 + {{if .Error}} 6 + <div class="alert alert-error">{{.Error}}</div> 7 + {{end}} 8 + <form method="post" action="/auth/atproto" class="auth-form"> 9 + <label>Bluesky handle 10 + <input type="text" name="handle" placeholder="alice.bsky.social" required autofocus 11 + autocomplete="username" spellcheck="false" autocorrect="off" autocapitalize="off"> 11 12 </label> 12 - <button type="submit" class="btn">Log In</button> 13 + <button type="submit" class="btn">Continue</button> 13 14 </form> 14 - <div class="auth-divider"><span>or</span></div> 15 - <div class="oauth-buttons"> 16 - <a href="/auth/github" class="btn btn-oauth">Sign in with GitHub</a> 17 - <a href="/auth/google" class="btn btn-oauth">Sign in with Google</a> 18 - </div> 19 - <p class="auth-switch">No account? <a href="/auth/register">Sign up</a></p> 15 + <p class="auth-switch">Don't have a Bluesky account? <a href="https://bsky.app" target="_blank" rel="noopener">Create one at bsky.app</a></p> 20 16 </div> 21 17 {{end}}
+7 -17
templates/register.html
··· 1 1 {{template "base" .}} 2 2 {{define "content"}} 3 3 <div class="auth-page"> 4 - <h2>Sign Up</h2> 5 - <form method="post" action="/auth/register" class="auth-form"> 6 - <label>Name 7 - <input type="text" name="name" required autofocus> 8 - </label> 9 - <label>Email 10 - <input type="email" name="email" required> 11 - </label> 12 - <label>Password (min 8 characters) 13 - <input type="password" name="password" minlength="8" required> 4 + <h2>Sign in with Bluesky</h2> 5 + <p>MarkdownHub uses your Bluesky account. No separate sign-up needed.</p> 6 + <form method="post" action="/auth/atproto" class="auth-form"> 7 + <label>Bluesky handle 8 + <input type="text" name="handle" placeholder="alice.bsky.social" required autofocus 9 + autocomplete="username" spellcheck="false" autocorrect="off" autocapitalize="off"> 14 10 </label> 15 - <button type="submit" class="btn">Create Account</button> 11 + <button type="submit" class="btn">Continue</button> 16 12 </form> 17 - <div class="auth-divider"><span>or</span></div> 18 - <div class="oauth-buttons"> 19 - <a href="/auth/github" class="btn btn-oauth">Sign up with GitHub</a> 20 - <a href="/auth/google" class="btn btn-oauth">Sign up with Google</a> 21 - </div> 22 - <p class="auth-switch">Already have an account? <a href="/auth/login">Log in</a></p> 23 13 </div> 24 14 {{end}}