From 00f858c8c157f451a134ea6dbda5b1c07cb710d3 Mon Sep 17 00:00:00 2001 From: Son NK Date: Mon, 22 Jul 2019 19:17:57 +0200 Subject: [PATCH] user can choose custom email in authorize --- app/oauth/templates/oauth/authorize.html | 215 ++++++++++++++--------- app/oauth/views/authorize.py | 48 ++++- static/style.css | 11 ++ 3 files changed, 185 insertions(+), 89 deletions(-) diff --git a/app/oauth/templates/oauth/authorize.html b/app/oauth/templates/oauth/authorize.html index d132c744..a6b6a550 100644 --- a/app/oauth/templates/oauth/authorize.html +++ b/app/oauth/templates/oauth/authorize.html @@ -5,99 +5,154 @@ {% endblock %} {% block default_content %} -
-
-
- - {% if client_user %} -
- You have already authorized {{ client.name }}. -
+ +
+ + {% if client_user %} +
+ You have already authorized {{ client.name }}. +
-
+
-
- {{ client.name }} has access to the following information: -
-
- {% for scope in client.get_scopes() %} -
- {% if scope == Scope.AVATAR_URL and user_info[scope.value] %} - avatar: - {% elif scope == Scope.EMAIL %} - {{ scope.value }}: - - {{ user_info[scope.value] }} - - {% elif scope == Scope.NAME %} - {{ scope.value }}: {{ user_info[scope.value] }} - {% endif %} -
- {% endfor %} -
- {% else %} -
- {{ client.name }} will receive your following information: -
- -
- {% for scope in client.get_scopes() %} -
- {% if scope == Scope.AVATAR_URL and current_user.profile_picture_id %} - avatar: - {% elif scope == Scope.EMAIL %} - {{ scope.value }}: - A random alias or your original email - {% elif scope == Scope.NAME %} - {{ scope.value }}: {{ current_user.name }} - {% endif %} -
- {% endfor %} +
+ {{ client.name }} has access to the following information: +
+
+ {% for scope in client.get_scopes() %} +
+ {% if scope == Scope.AVATAR_URL and user_info[scope.value] %} + avatar: + {% elif scope == Scope.EMAIL %} + {{ scope.value }}: + + {{ user_info[scope.value] }} + + {% elif scope == Scope.NAME %} + {{ scope.value }}: {{ user_info[scope.value] }} + {% endif %} +
+ {% endfor %} +
+ {% else %} + {% if client.icon_id %} +
+
{% endif %} - {% if client_user %} -