mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-14 15:37:55 +00:00
Remove auth_mode
This commit is contained in:
@@ -343,9 +343,9 @@ class AccountApi {
|
||||
async sync() {
|
||||
try {
|
||||
// For proxy auth, store the username from config if not already in session
|
||||
if (config.auth_mode === "proxy" && config.username && !session.exists()) {
|
||||
console.log(`[AccountApi] Proxy auth: storing session for user ${config.username}`);
|
||||
await session.store(config.username, ""); // Empty token for proxy auth
|
||||
if (config.auth_user && !session.exists()) {
|
||||
console.log(`[AccountApi] Proxy auth: storing session for user ${config.auth_user}`);
|
||||
await session.store(config.auth_user, ""); // Empty token for proxy auth
|
||||
}
|
||||
if (!session.exists()) {
|
||||
return null;
|
||||
|
||||
@@ -140,7 +140,7 @@ const ProfileIcon = () => {
|
||||
|
||||
const handleLogout = async () => {
|
||||
// For proxy auth, redirect to the logout URL if configured
|
||||
if (config.auth_mode === "proxy") {
|
||||
if (config.auth_user) {
|
||||
if (config.auth_logout_url) {
|
||||
await db().delete();
|
||||
localStorage.removeItem("user");
|
||||
@@ -158,8 +158,8 @@ const ProfileIcon = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// Determine if logout button should be shown
|
||||
const showLogout = config.auth_mode !== "proxy" || config.auth_logout_url;
|
||||
// Determine if logout button should be shown (hide if proxy auth without logout URL)
|
||||
const showLogout = !config.auth_user || config.auth_logout_url;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -20,7 +20,7 @@ const Login = () => {
|
||||
|
||||
// Redirect to app if using proxy authentication
|
||||
useEffect(() => {
|
||||
if (config.auth_mode === "proxy") {
|
||||
if (config.auth_user) {
|
||||
window.location.href = routes.app;
|
||||
}
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user