OIDC: use UserHelpers.has_oidc? in index and show

- Index OIDC column and show OIDC item use has_oidc? instead of raw oidc_id.
- Avoids empty string showing as Linked.
This commit is contained in:
Moritz 2026-02-04 11:40:21 +01:00
parent 503401f2e6
commit 24d130ffb5
2 changed files with 7 additions and 2 deletions

View file

@ -15,6 +15,8 @@
rows={@users}
row_id={fn user -> "row-#{user.id}" end}
row_click={fn user -> JS.navigate(~p"/users/#{user}") end}
sort_field={@sort_field}
sort_order={@sort_order}
>
<:col
:let={user}
@ -45,6 +47,7 @@
</:col>
<:col
:let={user}
sort_field={:email}
label={
sort_button(%{
field: :email,
@ -74,7 +77,7 @@
<% end %>
</:col>
<:col :let={user} label={gettext("OIDC")}>
<%= if user.oidc_id do %>
<%= if MvWeb.Helpers.UserHelpers.has_oidc?(user) do %>
<span>{gettext("Linked")}</span>
<% else %>
<span class="text-base-content/70">—</span>