diff --git a/src/main.py b/src/main.py index 1950020..5ba9ae3 100644 --- a/src/main.py +++ b/src/main.py @@ -105,12 +105,12 @@ def page_login(): @app.post("/login") def auth_login(): - username = request.form.get("username", "") - if username[0] == "@": - username = username[1:] - if not username: + value = request.form.get("username") or request.form.get("authserver") + if value and value[0] == "@": + value = value[1:] + if not value: return redirect(url_for("page_login"), 303) - return redirect(url_for("oauth.oauth_start", username=username), 303) + return redirect(url_for("oauth.oauth_start", username_or_authserver=value), 303) @app.route("/auth/logout") diff --git a/src/oauth.py b/src/oauth.py index 727cb61..5065236 100644 --- a/src/oauth.py +++ b/src/oauth.py @@ -30,7 +30,7 @@ oauth = Blueprint("oauth", __name__, url_prefix="/oauth") @oauth.get("/start") async def oauth_start(): # Identity - username = request.args.get("username") or request.args.get("authserver") + username = request.args.get("username_or_authserver") if not username: return redirect(url_for("page_login"), 303) diff --git a/src/static/style.css b/src/static/style.css index b78696f..6f593a5 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -80,6 +80,26 @@ input[type="submit"]:last-of-type { margin-top: 1em; } +.login .authservers { + margin-top: 2em; +} + +.login .authservers .caption { + display: block; + text-align: center; +} + +.login .authservers form { + display: grid; + gap: 0.25em; + grid-template-columns: 1fr 1fr; + margin-top: 0.75em; +} + +.login .authservers button { + font-weight: unset; +} + editor-label { display: block; } diff --git a/src/templates/login.html b/src/templates/login.html index f97f775..b6a5c73 100644 --- a/src/templates/login.html +++ b/src/templates/login.html @@ -24,13 +24,20 @@ Use your AT Protocol handle to log in. - If you're unsure you can - - log in with Bluesky - . + +