tangled
alpha
login
or
join now
diffdown.com
/
diffdown-app
0
fork
atom
Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol
diffdown.com
0
fork
atom
overview
issues
10
pulls
pipelines
feat: replace OAuth buttons with Bluesky handle login form
John Luther
1 month ago
554d53a1
14038c67
+35
-32
4 changed files
expand all
collapse all
unified
split
cmd
server
main.go
templates
atproto_login.html
login.html
register.html
+1
-1
cmd/server/main.go
reviewed
···
42
42
}
43
43
44
44
pages := []string{
45
45
-
"dashboard", "diff", "editor", "file_view", "history",
45
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
reviewed
···
1
1
+
{{template "base" .}}
2
2
+
{{define "content"}}
3
3
+
<div class="auth-page">
4
4
+
<h2>Sign in with Bluesky</h2>
5
5
+
{{if .Error}}
6
6
+
<div class="alert alert-error">{{.Error}}</div>
7
7
+
{{end}}
8
8
+
<form method="post" action="/auth/atproto" class="auth-form">
9
9
+
<label>Bluesky handle
10
10
+
<input type="text" name="handle" placeholder="alice.bsky.social" required autofocus
11
11
+
autocomplete="username" spellcheck="false" autocorrect="off" autocapitalize="off">
12
12
+
</label>
13
13
+
<button type="submit" class="btn">Continue</button>
14
14
+
</form>
15
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
16
+
</div>
17
17
+
{{end}}
+10
-14
templates/login.html
reviewed
···
1
1
{{template "base" .}}
2
2
{{define "content"}}
3
3
<div class="auth-page">
4
4
-
<h2>Log In</h2>
5
5
-
<form method="post" action="/auth/login" class="auth-form">
6
6
-
<label>Email
7
7
-
<input type="email" name="email" required autofocus>
8
8
-
</label>
9
9
-
<label>Password
10
10
-
<input type="password" name="password" required>
4
4
+
<h2>Sign in with Bluesky</h2>
5
5
+
{{if .Error}}
6
6
+
<div class="alert alert-error">{{.Error}}</div>
7
7
+
{{end}}
8
8
+
<form method="post" action="/auth/atproto" class="auth-form">
9
9
+
<label>Bluesky handle
10
10
+
<input type="text" name="handle" placeholder="alice.bsky.social" required autofocus
11
11
+
autocomplete="username" spellcheck="false" autocorrect="off" autocapitalize="off">
11
12
</label>
12
12
-
<button type="submit" class="btn">Log In</button>
13
13
+
<button type="submit" class="btn">Continue</button>
13
14
</form>
14
14
-
<div class="auth-divider"><span>or</span></div>
15
15
-
<div class="oauth-buttons">
16
16
-
<a href="/auth/github" class="btn btn-oauth">Sign in with GitHub</a>
17
17
-
<a href="/auth/google" class="btn btn-oauth">Sign in with Google</a>
18
18
-
</div>
19
19
-
<p class="auth-switch">No account? <a href="/auth/register">Sign up</a></p>
15
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
reviewed
···
1
1
{{template "base" .}}
2
2
{{define "content"}}
3
3
<div class="auth-page">
4
4
-
<h2>Sign Up</h2>
5
5
-
<form method="post" action="/auth/register" class="auth-form">
6
6
-
<label>Name
7
7
-
<input type="text" name="name" required autofocus>
8
8
-
</label>
9
9
-
<label>Email
10
10
-
<input type="email" name="email" required>
11
11
-
</label>
12
12
-
<label>Password (min 8 characters)
13
13
-
<input type="password" name="password" minlength="8" required>
4
4
+
<h2>Sign in with Bluesky</h2>
5
5
+
<p>MarkdownHub uses your Bluesky account. No separate sign-up needed.</p>
6
6
+
<form method="post" action="/auth/atproto" class="auth-form">
7
7
+
<label>Bluesky handle
8
8
+
<input type="text" name="handle" placeholder="alice.bsky.social" required autofocus
9
9
+
autocomplete="username" spellcheck="false" autocorrect="off" autocapitalize="off">
14
10
</label>
15
15
-
<button type="submit" class="btn">Create Account</button>
11
11
+
<button type="submit" class="btn">Continue</button>
16
12
</form>
17
17
-
<div class="auth-divider"><span>or</span></div>
18
18
-
<div class="oauth-buttons">
19
19
-
<a href="/auth/github" class="btn btn-oauth">Sign up with GitHub</a>
20
20
-
<a href="/auth/google" class="btn btn-oauth">Sign up with Google</a>
21
21
-
</div>
22
22
-
<p class="auth-switch">Already have an account? <a href="/auth/login">Log in</a></p>
23
13
</div>
24
14
{{end}}