@app.route('/whoami')
def who_am_i():
    if current_user.is_authenticated:
        name = current_user.name
    else:
        name = 'Anonymous'
    return jsonify({'name': name})
@app.route('/whoami')
def who_am_i():
    if current_user.is_authenticated:
        name = current_user.name
    else:
        name = 'Anonymous'
    return jsonify({'name': name})