Skip to content

Commit

Permalink
remove AuthenticationMethods from sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Dec 6, 2023
1 parent e220a59 commit 7bc8f24
Showing 1 changed file with 48 additions and 46 deletions.
94 changes: 48 additions & 46 deletions KratosSelfService/Views/Sessions/Sessions.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,62 @@
var totalSessions = Model.OtherSessions.Count + 1;
}

<section class="section">
<h1 class="title">@CustomTranslator.Get("sessions.title")</h1>
<h2 class="subtitle">You have @totalSessions active session@(totalSessions == 1 ? "" : "s").</h2>
<h4 class="title mt-3">@CustomTranslator.Get("sessions.currentSession")</h4>
<table class="table is-fullwidth">
<thead>
<tr>
<td>@CustomTranslator.Get("sessions.devices")</td>
<td>@CustomTranslator.Get("sessions.authenticatedWith")</td>
<td>@CustomTranslator.Get("sessions.authenticatedAt")</td>
<td>@CustomTranslator.Get("sessions.expiresAt")</td>
</tr>
</thead>
<tbody>
<tr>
<td>@string.Join(", ", Model.CurrentSession.Devices.Select(device => device.IpAddress))</td>
<td>@string.Join(", ", Model.CurrentSession.AuthenticationMethods.Select(method => method.Method.ToString()))</td>
<td>@Model.CurrentSession.AuthenticatedAt</td>
<td>@Model.CurrentSession.ExpiresAt</td>
</tr>
</tbody>
</table>
<h4 class="title mt-3">@CustomTranslator.Get("sessions.otherSessions")</h4>
@if (Model.OtherSessions.Count == 0)
{
<p>@CustomTranslator.Get("sessions.noOtherActiveSessions")</p>
}
else
{
<div class="buttons">
<a class="button is-warning" href="sessions-logout">
@CustomTranslator.Get("sessions.logoutOtherSessions")
</a>
</div>
<div class="section">
<div class="box">
<h1 class="title">@CustomTranslator.Get("sessions.title")</h1>
<h2 class="subtitle">You have @totalSessions active session@(totalSessions == 1 ? "" : "s").</h2>
</div>
<div class="box">
<h4 class="title mt-3">@CustomTranslator.Get("sessions.currentSession")</h4>
<table class="table is-fullwidth">
<thead>
<tr>
<td>@CustomTranslator.Get("sessions.devices")</td>
<td>@CustomTranslator.Get("sessions.authenticationMethods")</td>
<td>@CustomTranslator.Get("sessions.authenticatedAt")</td>
<td>@CustomTranslator.Get("sessions.expiresAt")</td>
</tr>
</thead>
<tbody>
@foreach (var session in Model.OtherSessions)
{
<tr>
<td>@string.Join(", ", session.Devices.Select(device => device.IpAddress))</td>
<td>@string.Join(", ", session.AuthenticationMethods.Select(method => method.Method.ToString()))</td>
<td>@session.AuthenticatedAt</td>
<td>@session.ExpiresAt</td>
</tr>
}
<tr>
<td>@string.Join(", ", Model.CurrentSession.Devices.Select(device => device.IpAddress))</td>
<td>@Model.CurrentSession.AuthenticatedAt</td>
<td>@Model.CurrentSession.ExpiresAt</td>
</tr>
</tbody>
</table>
}
</section>
</div>
<div class="box">
<h4 class="title mt-3">@CustomTranslator.Get("sessions.otherSessions")</h4>
@if (Model.OtherSessions.Count == 0)
{
<p>@CustomTranslator.Get("sessions.noOtherActiveSessions")</p>
}
else
{
<div class="buttons">
<a class="button is-warning" href="sessions-logout">
@CustomTranslator.Get("sessions.logoutOtherSessions")
</a>
</div>
<table class="table is-fullwidth">
<thead>
<tr>
<td>@CustomTranslator.Get("sessions.devices")</td>
<td>@CustomTranslator.Get("sessions.authenticatedAt")</td>
<td>@CustomTranslator.Get("sessions.expiresAt")</td>
</tr>
</thead>
<tbody>
@foreach (var session in Model.OtherSessions)
{
<tr>
<td>@string.Join(", ", session.Devices.Select(device => device.IpAddress))</td>
<td>@session.AuthenticatedAt</td>
<td>@session.ExpiresAt</td>
</tr>
}
</tbody>
</table>
}
</div>
</div>

0 comments on commit 7bc8f24

Please sign in to comment.