Skip to content

Commit

Permalink
Return raw useragent if unidentifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Oct 28, 2024
1 parent edb3359 commit 3e5ede8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/routes/(authenticated)/settings/sessions/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@
const browser = ua.getBrowser();
const os = ua.getOS();
return `${browser.name} on ${os.name} ${os.version}`;
if (!browser.name || !os.name) return userAgent;
let name = `${browser.name} on ${os.name}`;
if (os.version) name += ` ${os.version}`;
return name;
}
listSessions();
Expand Down

0 comments on commit 3e5ede8

Please sign in to comment.