Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created March 30, 2020 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/b6b92ceca2a7a07b72f98b80d272e535 to your computer and use it in GitHub Desktop.
Save Porter97/b6b92ceca2a7a07b72f98b80d272e535 to your computer and use it in GitHub Desktop.
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