Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3548,10 +3548,21 @@
"UpdateContents": [
{
"PR": 969,
"Description": "Migrate XMOJ-BBS client endpoints to routes"
"Description": "Migrate XMOJ-BBS client endpoints to /v1 routes"
}
],
"Notes": "No release notes were provided for this release."
},
"3.4.4": {
"UpdateDate": 1775973614570,
"Prerelease": true,
"UpdateContents": [
{
"PR": 971,
"Description": "Fix loginpage.php Loop"
}
],
"Notes": "Fix loginpage.php loop."
}
}
}
5 changes: 4 additions & 1 deletion XMOJ.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name XMOJ
// @version 3.4.3
// @version 3.4.4
// @description XMOJ增强脚本
// @author @XMOJ-Script-dev, @langningchen and the community
// @namespace https://github/langningchen
Expand Down Expand Up @@ -912,13 +912,15 @@ GM_registerMenuCommand("重置数据", () => {

//otherwise CurrentUsername might be undefined
if (UtilityEnabled("AutoLogin") && document.querySelector("body > a:nth-child(1)") != null && document.querySelector("body > a:nth-child(1)").innerText == "请登录后继续操作") {
if (document.querySelector('a').innerText == "Please logout First!") location.href = localStorage.getItem("UserScript-LastPage");
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The new "Please logout First!" redirect is immediately overridden by a following unconditional redirect, so it does not actually break the login loop.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At XMOJ.user.js, line 863:

<comment>The new "Please logout First!" redirect is immediately overridden by a following unconditional redirect, so it does not actually break the login loop.</comment>

<file context>
@@ -860,13 +860,15 @@ GM_registerMenuCommand("重置数据", () => {
 
 //otherwise CurrentUsername might be undefined
 if (UtilityEnabled("AutoLogin") && document.querySelector("body > a:nth-child(1)") != null && document.querySelector("body > a:nth-child(1)").innerText == "请登录后继续操作") {
+    if (document.querySelector('a').innerText == "Please logout First!") location.href = localStorage.getItem("UserScript-LastPage");
     localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
     location.href = "https://www.xmoj.tech/loginpage.php";
</file context>
Fix with Cubic

localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
location.href = "https://www.xmoj.tech/loginpage.php";
}

let SearchParams = new URLSearchParams(location.search);
let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me")
if (document.querySelector("#profile") === null) {
if (document.querySelector('a').innerText == "Please logout First!") location.href = localStorage.getItem("UserScript-LastPage");
location.href = "https://www.xmoj.tech/loginpage.php";
}
let CurrentUsername = document.querySelector("#profile").innerText;
Expand Down Expand Up @@ -1184,6 +1186,7 @@ async function main() {
}

if (UtilityEnabled("AutoLogin") && document.querySelector("#profile") != null && document.querySelector("#profile").innerHTML == "登录" && location.pathname != "/login.php" && location.pathname != "/loginpage.php" && location.pathname != "/lostpassword.php") {
if (document.querySelector('a').innerText == "Please logout First!") location.href = localStorage.getItem("UserScript-LastPage");
localStorage.setItem("UserScript-LastPage", location.pathname + location.search);
location.href = "https://www.xmoj.tech/loginpage.php";
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmoj-script",
"version": "3.4.3",
"version": "3.4.4",

This comment was marked as resolved.

"description": "an improvement script for xmoj.tech",
"main": "AddonScript.js",
"scripts": {
Expand Down