Created
March 30, 2020 17:55
-
-
Save Porter97/b6b92ceca2a7a07b72f98b80d272e535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import render_template, jsonify | |
from flask_login import login_required, current_user | |
from . import main | |
@main.route('/') | |
def index(): | |
return render_template("index.html") | |
@main.route('/user', methods=['GET']) | |
@login_required | |
def get_current_user(): | |
return jsonify({'user': current_user.to_json()}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment