fix: should fix issues with login/session handling
This commit is contained in:
@@ -1214,7 +1214,9 @@ function ActiveSessions(props: { userId: string }) {
|
||||
};
|
||||
|
||||
const formatDate = (dateStr: string) => {
|
||||
return new Date(dateStr).toLocaleString(undefined, {
|
||||
// Database stores UTC time, convert to local timezone
|
||||
const date = new Date(dateStr + (dateStr.includes("Z") ? "" : "Z"));
|
||||
return date.toLocaleString(undefined, {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
@@ -1266,6 +1268,15 @@ function ActiveSessions(props: { userId: string }) {
|
||||
<Show when={session.expiresAt}>
|
||||
<div class="text-xs">
|
||||
Expires: {formatDate(session.expiresAt)}
|
||||
{session.rememberMe !== undefined && (
|
||||
<span class="text-subtext1 ml-2">
|
||||
(
|
||||
{session.rememberMe
|
||||
? "Remember me"
|
||||
: "Session-only"}
|
||||
)
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
@@ -547,7 +547,12 @@ export default function LoginPage() {
|
||||
</Show>
|
||||
|
||||
<div class="mx-auto flex pt-4">
|
||||
<input type="checkbox" class="my-auto" ref={rememberMeRef} />
|
||||
<input
|
||||
type="checkbox"
|
||||
class="my-auto"
|
||||
ref={rememberMeRef}
|
||||
checked
|
||||
/>
|
||||
<div class="my-auto px-2 text-sm font-normal">Remember Me</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user