Skip to content

Commit

Permalink
Merge pull request #310 from colts661/ywang_account_auth_status
Browse files Browse the repository at this point in the history
Add AuthRocket Status to account search
  • Loading branch information
cassidysymons authored Jan 29, 2024
2 parents 9ce12d1 + 62649a9 commit 1410a76
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
17 changes: 15 additions & 2 deletions microsetta_interface/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2782,8 +2782,21 @@ def get_interactive_account_search(email_query):
if do_return:
return email_diagnostics

accounts = [{"email": acct['email'], "account_id": acct['id']}
for acct in email_diagnostics['accounts']]
accounts = []
for acct in email_diagnostics['accounts']:
if acct['auth_issuer'] is None and acct['auth_sub'] is None:
authrocket_status = "Missing"
elif acct['auth_issuer'] is None or acct['auth_sub'] is None:
authrocket_status = "Faulty - Contact Admin"
else:
authrocket_status = "Authenticated"
acct_diag = {
"email": acct['email'],
"account_id": acct['id'],
"authrocket_status": authrocket_status
}
accounts.append(acct_diag)

return _render_with_defaults('admin_home.jinja2',
accounts=accounts)

Expand Down
10 changes: 8 additions & 2 deletions microsetta_interface/templates/admin_home.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@
<div class="col-sm">
<i>{{ _('Account ID') }}</i>
</div>
<div class="col-sm">
<i>{{ _('AuthRocket Status') }}</i>
</div>
</div>
{% for account in accounts %}
<div class="container list-group-item {{loop.cycle('odd', 'even') }}">
<div class="row">
<div class="col-sm">
<div class="col-sm" style="word-wrap: break-word; overflow: hidden;">
<a href="/accounts/{{account.account_id |e}}">
{{ account.email |e}}
</a>
</div>
<div class="col-sm">
<div class="col-sm" style="word-wrap: break-word; overflow: hidden;">
{{ account.account_id|e }}
</div>
<div class="col-sm">
{{ account.authrocket_status|e }}
</div>
</div>
</div>
{% endfor %}
Expand Down

0 comments on commit 1410a76

Please sign in to comment.