decentralized and customizable links page on top of atproto

Compare changes

Choose any two refs to compare.

Changed files
+37 -10
src
+5 -5
src/main.py
··· 105 105 106 106 @app.post("/login") 107 107 def auth_login(): 108 - username = request.form.get("username", "") 109 - if username[0] == "@": 110 - username = username[1:] 111 - if not username: 108 + value = request.form.get("username") or request.form.get("authserver") 109 + if value and value[0] == "@": 110 + value = value[1:] 111 + if not value: 112 112 return redirect(url_for("page_login"), 303) 113 - return redirect(url_for("oauth.oauth_start", username=username), 303) 113 + return redirect(url_for("oauth.oauth_start", username_or_authserver=value), 303) 114 114 115 115 116 116 @app.route("/auth/logout")
+1 -1
src/oauth.py
··· 30 30 @oauth.get("/start") 31 31 async def oauth_start(): 32 32 # Identity 33 - username = request.args.get("username") or request.args.get("authserver") 33 + username = request.args.get("username_or_authserver") 34 34 if not username: 35 35 return redirect(url_for("page_login"), 303) 36 36
+20
src/static/style.css
··· 80 80 margin-top: 1em; 81 81 } 82 82 83 + .login .authservers { 84 + margin-top: 2em; 85 + } 86 + 87 + .login .authservers .caption { 88 + display: block; 89 + text-align: center; 90 + } 91 + 92 + .login .authservers form { 93 + display: grid; 94 + gap: 0.25em; 95 + grid-template-columns: 1fr 1fr; 96 + margin-top: 0.75em; 97 + } 98 + 99 + .login .authservers button { 100 + font-weight: unset; 101 + } 102 + 83 103 editor-label { 84 104 display: block; 85 105 }
+11 -4
src/templates/login.html
··· 24 24 </label> 25 25 <span class="faded caption"> 26 26 Use your AT Protocol handle to log in. 27 - If you're unsure you can 28 - <a href="{{ url_for('oauth.oauth_start', authserver='https://bsky.social') }}" rel="nofollow"> 29 - log in with Bluesky 30 - </a>. 31 27 </span> 32 28 <input type="submit" value="continue" /> 33 29 </form> 30 + 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 + 34 41 <footer> 35 42 <p> 36 43 <a href="/">home</a>