diff --git a/ajusta_bling/web/__init__.py b/ajusta_bling/web/__init__.py index 09f3d9a..4b289cc 100644 --- a/ajusta_bling/web/__init__.py +++ b/ajusta_bling/web/__init__.py @@ -15,7 +15,7 @@ app = Flask(__name__) app.secret_key = "#^A549639t5@#&$p" db: Database | None = None -@app.route('/auth') +@app.get('/auth') def auth(): session["state"] = secrets.token_urlsafe(16) @@ -26,11 +26,8 @@ def auth(): "state": session["state"] }) -@app.route('/callback', methods = ["GET"]) +@app.get('/callback') def callback(): - if request.method != "GET": - return "I curse you!", 403 - if request.args.get("state") != session.pop("state", "fartnugget"): return "I banish thee, to the state of Ohio", 403