Skip to content

Commit

Permalink
Allow token entry via GET
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerburleigh committed Jul 15, 2018
1 parent 64fde0a commit 3c75839
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions expfactory/views/headless.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

# HEADLESS LOGIN ###############################################################

@app.route('/login', methods=['POST'])
@app.route('/login', methods=['POST', 'GET'])
def login():

# Only allowed to login via post from entry (headless) url
Expand All @@ -74,8 +74,12 @@ def login():

subid = session.get('subid')
if not subid:
if form.validate_on_submit():
token = form.token.data
if form.validate_on_submit() or request.args.get('token') is not None:
if form.validate_on_submit():
token = form.token.data
else:
token = request.args.get('token')
session['experiments'] = [os.path.basename(x) for x in app.experiments]

subid = app.validate_token(token)
if subid is None:
Expand Down

0 comments on commit 3c75839

Please sign in to comment.