Skip to content

Commit ff2c0e4

Browse files
authored
Merge pull request #811 from XMOJ-Script-dev/boomzero/reg
fix: Redirect to login page if profile element is missing
2 parents fa5a812 + b28f440 commit ff2c0e4

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Update.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,6 +2873,17 @@
28732873
}
28742874
],
28752875
"Notes": "No release notes were provided for this release."
2876+
},
2877+
"1.7.3": {
2878+
"UpdateDate": 1750594769202,
2879+
"Prerelease": true,
2880+
"UpdateContents": [
2881+
{
2882+
"PR": 811,
2883+
"Description": "fix: Redirect to login page if profile element is missing"
2884+
}
2885+
],
2886+
"Notes": "No release notes were provided for this release."
28762887
}
28772888
}
28782889
}

XMOJ.user.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name XMOJ
3-
// @version 1.7.2
3+
// @version 1.7.3
44
// @description XMOJ增强脚本
55
// @author @XMOJ-Script-dev, @langningchen and the community
66
// @namespace https://github/langningchen
@@ -559,6 +559,9 @@ window.addEventListener('DOMContentLoaded', async () => {
559559

560560
let SearchParams = new URLSearchParams(location.search);
561561
let ServerURL = (UtilityEnabled("DebugMode") ? "https://ghpages.xmoj-bbs.me/" : "https://www.xmoj-bbs.me")
562+
if (document.querySelector("#profile") === null) {
563+
location.href = "https://www.xmoj.tech/loginpage.php";
564+
}
562565
let CurrentUsername = document.querySelector("#profile").innerText;
563566
CurrentUsername = CurrentUsername.replaceAll(/[^a-zA-Z0-9]/g, "");
564567
let IsAdmin = AdminUserList.indexOf(CurrentUsername) !== -1;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xmoj-script",
3-
"version": "1.7.2",
3+
"version": "1.7.3",
44
"description": "an improvement script for xmoj.tech",
55
"main": "AddonScript.js",
66
"scripts": {

0 commit comments

Comments
 (0)