diff --git a/auth.py b/auth.py index 72818b5..3c4f13c 100644 --- a/auth.py +++ b/auth.py @@ -280,10 +280,11 @@ class LoginForm(FlaskForm): password = PasswordField('password', validators=[DataRequired()]) +@app.route('/') @app.route('/profile') @login_required def profile(): - return 'You are logged in as {}'.format(current_user.email) + return render_template('profile.html', tokens=Token.query.filter(Token.user == current_user.username)) @app.route('/token//revoke', methods=['POST']) diff --git a/static/css/authorize.css b/static/css/authorize.css index 1bb8266..6695764 100644 --- a/static/css/authorize.css +++ b/static/css/authorize.css @@ -22,3 +22,8 @@ body { font-size: 14px; } +td.placeholder { + text-align: center; + font-style: italic; + opacity: 0.5; +} diff --git a/templates/profile.html b/templates/profile.html new file mode 100644 index 0000000..60affb1 --- /dev/null +++ b/templates/profile.html @@ -0,0 +1,45 @@ +{% extends "base.html" %} + +{% block content %} +
+
+

+ Hey, {{ current_user.gecos }}! + Logout +

+

Approved applications

+ + + + + + + + + + + {% for token in tokens %} + + + + + + + {% else %} + + {% endfor %} + +
Application nameScopesExpires
+ {% if token.client.approved %}{% endif %} + {{ token.client.name }} + + {% for scope in token.scopes %}{{ scope }} {% endfor %} + {{ token.expires }} +
+ {# FIXME #} + +
+
No authorized applications yet
+
+
+{% endblock %}