2
0
mirror of https://github.com/codl/forget synced 2025-01-22 20:00:44 +01:00

mastodon login: strip protocol

This commit is contained in:
codl 2017-09-08 00:38:54 +02:00
parent 146dd263c9
commit d7e1a7f179
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A

View File

@ -16,6 +16,7 @@ import version
import lib.version import lib.version
import lib.settings import lib.settings
import lib.json import lib.json
import re
@app.before_request @app.before_request
@ -275,6 +276,8 @@ def mastodon_login_step1(instance=None):
generic_error='error' in request.args generic_error='error' in request.args
) )
instance_url = re.sub('^https?://', '', instance_url,
count=1, flags=re.IGNORECASE)
instance_url = instance_url.split("@")[-1].lower() instance_url = instance_url.split("@")[-1].lower()
callback = url_for('mastodon_login_step2', callback = url_for('mastodon_login_step2',
@ -349,6 +352,7 @@ def delete_reason():
db.session.commit() db.session.commit()
return jsonify(status='success') return jsonify(status='success')
@app.route('/api/badge/users') @app.route('/api/badge/users')
def users_badge(): def users_badge():
count = ( count = (