Use urlencode for building Discourse redirect URL
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d8f5a7f77c
commit
b95ce03030
|
|
@ -1 +1,2 @@
|
||||||
config.yaml
|
config.yaml
|
||||||
|
/venv/
|
||||||
|
|
|
||||||
4
app.py
4
app.py
|
|
@ -2,6 +2,7 @@ import argparse
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
import secrets
|
import secrets
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
|
|
@ -46,8 +47,7 @@ def authorize():
|
||||||
"nonce": nonce,
|
"nonce": nonce,
|
||||||
"public_key": public_key,
|
"public_key": public_key,
|
||||||
}
|
}
|
||||||
query = "&".join(f"{k}={v}" for k, v in params.items())
|
return redirect(f"{config['forum_url']}/user-api-key/new?{urlencode(params)}")
|
||||||
return redirect(f"{config['forum_url']}/user-api-key/new?{query}")
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/callback")
|
@app.route("/callback")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue