tangled
alpha
login
or
join now
ligo.at
/
core
6
fork
atom
decentralized and customizable links page on top of atproto
ligo.at
atproto
link-in-bio
python
uv
6
fork
atom
overview
issues
2
pulls
pipelines
make auth_servers configurable by code
nauta.one
1 month ago
b4d83b28
0cd5bb22
+22
-5
2 changed files
expand all
collapse all
unified
split
src
main.py
templates
login.html
+19
-1
src/main.py
···
96
96
)
97
97
98
98
99
99
+
class AuthServer(NamedTuple):
100
100
+
name: str
101
101
+
url: str
102
102
+
103
103
+
104
104
+
auth_servers: list[AuthServer] = [
105
105
+
AuthServer("Bluesky", "https://bsky.social"),
106
106
+
AuthServer("Blacksky", "https://blacksky.app"),
107
107
+
AuthServer("Northsky", "https://northsky.social"),
108
108
+
AuthServer("tangled.org", "https://tngl.sh"),
109
109
+
AuthServer("Witchraft Systems", "https://pds.witchcraft.systems"),
110
110
+
AuthServer("selfhosted.social", "https://selfhosted.social"),
111
111
+
]
112
112
+
113
113
+
if app.debug:
114
114
+
auth_servers.append(AuthServer("pds.rip", "https://pds.rip"))
115
115
+
116
116
+
99
117
@app.get("/login")
100
118
def page_login():
101
119
if get_user() is not None:
102
120
return redirect("/editor")
103
103
-
return render_template("login.html")
121
121
+
return render_template("login.html", auth_servers=auth_servers)
104
122
105
123
106
124
@app.post("/login")
+3
-4
src/templates/login.html
···
31
31
<div class="authservers">
32
32
<span class="faded caption">If you're unsure you can log in with...</span>
33
33
<form action="{{ url_for('auth_login') }}" method="post">
34
34
-
<button type="submit" name="authserver" value="https://bsky.social">Bluesky</button>
35
35
-
<button type="submit" name="authserver" value="https://blacksky.app">Blacksky</button>
36
36
-
<button type="submit" name="authserver" value="https://tngl.sh">tangled</button>
37
37
-
<button type="submit" name="authserver" value="https://pds.witchcraft.systems">Witchraft Systems</button>
34
34
+
{% for server in auth_servers %}
35
35
+
<button type="submit" name="authserver" value="{{ server.url }}">{{ server.name }}</button>
36
36
+
{% endfor %}
38
37
</form>
39
38
</div>
40
39