Compare commits
2 Commits
556b8cbe50
...
e45632630a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e45632630a | ||
![]() |
1a7307b89f |
@@ -82,7 +82,7 @@ def login_callback():
|
|||||||
return f"Could not get profile information: {profile['reason']}"
|
return f"Could not get profile information: {profile['reason']}"
|
||||||
|
|
||||||
if db.google_check_sso_uuid(profile['profile']['sub'])['error'] is True:
|
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_profile(profile['profile'])
|
||||||
db.google_update_lastlogin(profile['profile']['sub'])
|
db.google_update_lastlogin(profile['profile']['sub'])
|
||||||
@@ -104,7 +104,7 @@ def dashboard():
|
|||||||
va = request.form.get('value')
|
va = request.form.get('value')
|
||||||
rq = request.form.get('request')
|
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?'
|
return 'Invalid request, did you use the dashboard?'
|
||||||
|
|
||||||
if rq == 'Add' or rq == 'Update':
|
if rq == 'Add' or rq == 'Update':
|
||||||
@@ -127,6 +127,9 @@ def dashboard():
|
|||||||
jwt = db.google_get_jwt(session['username'])
|
jwt = db.google_get_jwt(session['username'])
|
||||||
flash(jwt)
|
flash(jwt)
|
||||||
|
|
||||||
|
elif rq == "Add SUB":
|
||||||
|
db.google_add_new_sub(va)
|
||||||
|
|
||||||
uuid = session['username']
|
uuid = session['username']
|
||||||
profile = db.google_get_profile(uuid)
|
profile = db.google_get_profile(uuid)
|
||||||
lastlogin = db.google_get_lastlogin(uuid)
|
lastlogin = db.google_get_lastlogin(uuid)
|
||||||
|
@@ -53,6 +53,16 @@ th {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</tr>
|
</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>
|
</table>
|
||||||
<hr>
|
<hr>
|
||||||
<h4>DNS Records school.test</h4>
|
<h4>DNS Records school.test</h4>
|
||||||
|
@@ -9,7 +9,7 @@ class GoogleOID:
|
|||||||
|
|
||||||
self.settings = {'client_id': '954325872153-1v466clrtgg6h4ptt2ne5pgpb9mhilr5.apps.googleusercontent.com',
|
self.settings = {'client_id': '954325872153-1v466clrtgg6h4ptt2ne5pgpb9mhilr5.apps.googleusercontent.com',
|
||||||
'client_secret': client_secret,
|
'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'}
|
'key_server': 'https://www.googleapis.com/oauth2/v3/certs'}
|
||||||
|
|
||||||
def settings(self):
|
def settings(self):
|
||||||
|
Reference in New Issue
Block a user