decentralized and customizable links page on top of atproto ligo.at
atproto link-in-bio python uv

make auth_servers configurable by code

+22 -5
+19 -1
src/main.py
··· 96 ) 97 98 99 @app.get("/login") 100 def page_login(): 101 if get_user() is not None: 102 return redirect("/editor") 103 - return render_template("login.html") 104 105 106 @app.post("/login")
··· 96 ) 97 98 99 + class AuthServer(NamedTuple): 100 + name: str 101 + url: str 102 + 103 + 104 + auth_servers: list[AuthServer] = [ 105 + AuthServer("Bluesky", "https://bsky.social"), 106 + AuthServer("Blacksky", "https://blacksky.app"), 107 + AuthServer("Northsky", "https://northsky.social"), 108 + AuthServer("tangled.org", "https://tngl.sh"), 109 + AuthServer("Witchraft Systems", "https://pds.witchcraft.systems"), 110 + AuthServer("selfhosted.social", "https://selfhosted.social"), 111 + ] 112 + 113 + if app.debug: 114 + auth_servers.append(AuthServer("pds.rip", "https://pds.rip")) 115 + 116 + 117 @app.get("/login") 118 def page_login(): 119 if get_user() is not None: 120 return redirect("/editor") 121 + return render_template("login.html", auth_servers=auth_servers) 122 123 124 @app.post("/login")
+3 -4
src/templates/login.html
··· 31 <div class="authservers"> 32 <span class="faded caption">If you're unsure you can log in with...</span> 33 <form action="{{ url_for('auth_login') }}" method="post"> 34 - <button type="submit" name="authserver" value="https://bsky.social">Bluesky</button> 35 - <button type="submit" name="authserver" value="https://blacksky.app">Blacksky</button> 36 - <button type="submit" name="authserver" value="https://tngl.sh">tangled</button> 37 - <button type="submit" name="authserver" value="https://pds.witchcraft.systems">Witchraft Systems</button> 38 </form> 39 </div> 40
··· 31 <div class="authservers"> 32 <span class="faded caption">If you're unsure you can log in with...</span> 33 <form action="{{ url_for('auth_login') }}" method="post"> 34 + {% for server in auth_servers %} 35 + <button type="submit" name="authserver" value="{{ server.url }}">{{ server.name }}</button> 36 + {% endfor %} 37 </form> 38 </div> 39