Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AuthRocket Status to account search #310

Merged
merged 4 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading