Pass next URL to OAuth
This commit is contained in:
parent
51c245d637
commit
37af9ad1c0
6
app.py
6
app.py
|
@ -115,6 +115,12 @@ def set_url_args(**new_args):
|
|||
args = {k: v for k, v in args.items() if v is not None}
|
||||
return url_for(request.endpoint, **args)
|
||||
|
||||
@app.template_global()
|
||||
def current_url():
|
||||
args = request.view_args.copy()
|
||||
args.update(request.args)
|
||||
return url_for(request.endpoint, **args)
|
||||
|
||||
@app.before_request
|
||||
def init_profile():
|
||||
g.profiling = []
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<div class="alert alert-info mt-4" role="alert">
|
||||
This tool must be connected with Wikidata to work.
|
||||
</div>
|
||||
<p><a href="{{ url_for('start_oauth') }}" class="btn btn-primary btn-lg">Connect with Wikidata</a>
|
||||
<p><a href="{{ url_for('start_oauth', next=current_url()) }}" class="btn btn-primary btn-lg">Connect with Wikidata</a>
|
||||
{% endif %}
|
||||
|
||||
{% if username %}
|
||||
|
|
Loading…
Reference in a new issue