add: user totp 2fa

This commit is contained in:
trisua 2025-04-04 21:42:08 -04:00
parent 20aae5570b
commit 205fcbdcc1
29 changed files with 699 additions and 116 deletions

View file

@ -415,9 +415,7 @@ media_theme_pref();
try {
const href = new URL(anchor.href);
if (
href.pathname.startsWith("/api/v1/auth/profile/find_by_ip/")
) {
if (href.pathname.startsWith("/api/v1/auth/user/find_by_ip/")) {
const ban_button = document.createElement("button");
ban_button.innerText = "Ban IP";
ban_button.className = "quaternary red small";
@ -428,7 +426,7 @@ media_theme_pref();
$.ban_ip(
href.pathname.replace(
"/api/v1/auth/profile/find_by_ip/",
"/api/v1/auth/user/find_by_ip/",
"",
),
);

View file

@ -156,7 +156,7 @@
});
self.define("seen", () => {
fetch("/api/v1/auth/profile/me/seen", {
fetch("/api/v1/auth/user/me/seen", {
method: "POST",
})
.then((res) => res.json())
@ -196,7 +196,7 @@
element.innerHTML += `<button class="quaternary w-full justify-start" onclick="trigger('me::login', ['${token[0]}'])">
<img
title="${token[0]}'s avatar"
src="/api/v1/auth/profile/${token[0]}/avatar?selector_type=username"
src="/api/v1/auth/user/${token[0]}/avatar?selector_type=username"
alt="Avatar image"
class="avatar"
style="--size: 24px"