Archived
1

Compare commits

...

2 Commits

Author SHA1 Message Date
ventilaar
e45632630a change to real dns address 2022-03-21 13:50:17 +01:00
ventilaar
1a7307b89f add option to add sub id to database. and return sub id if account may not login 2022-03-21 13:50:09 +01:00
3 changed files with 16 additions and 3 deletions

View File

@@ -82,7 +82,7 @@ def login_callback():
return f"Could not get profile information: {profile['reason']}"
if db.google_check_sso_uuid(profile['profile']['sub'])['error'] is True:
return 'Account is unavailable for login'
return f"Account is unavailable for login {profile['profile']['sub']}"
db.google_update_profile(profile['profile'])
db.google_update_lastlogin(profile['profile']['sub'])
@@ -104,7 +104,7 @@ def dashboard():
va = request.form.get('value')
rq = request.form.get('request')
if rq != "Add" and rq != "Delete" and rq != "Update" and rq != "Query JWT":
if rq != "Add" and rq != "Delete" and rq != "Update" and rq != "Query JWT" and rq != "Add SUB":
return 'Invalid request, did you use the dashboard?'
if rq == 'Add' or rq == 'Update':
@@ -127,6 +127,9 @@ def dashboard():
jwt = db.google_get_jwt(session['username'])
flash(jwt)
elif rq == "Add SUB":
db.google_add_new_sub(va)
uuid = session['username']
profile = db.google_get_profile(uuid)
lastlogin = db.google_get_lastlogin(uuid)

View File

@@ -53,6 +53,16 @@ th {
{% endif %}
{% endwith %}
</tr>
<form method="POST">
<tr>
<td>
<input type="submit" value="Add SUB" name="request" >
</td>
<td>
<input placeholder="Google UUID" name="value">
</td>
</tr>
</form>
</table>
<hr>
<h4>DNS Records school.test</h4>

View File

@@ -9,7 +9,7 @@ class GoogleOID:
self.settings = {'client_id': '954325872153-1v466clrtgg6h4ptt2ne5pgpb9mhilr5.apps.googleusercontent.com',
'client_secret': client_secret,
'callback_uri': 'http://127.0.0.1.nip.io:5000/login/gcp/callback',
'callback_uri': 'http://dns.mashallah.nl:5000/login/gcp/callback',
'key_server': 'https://www.googleapis.com/oauth2/v3/certs'}
def settings(self):