From 70dedfb9eeac5f85110898e63c91bfbe7c80f01c Mon Sep 17 00:00:00 2001 From: Felitendo Date: Thu, 17 Sep 2026 16:14:11 +0200 Subject: [PATCH] feat: add accounts from custom servers (#1) --- README.md | 29 +- ...-from-other-authlib-injector-servers.patch | 1704 +++++++++++++++++ scripts/check.sh | 12 + 3 files changed, 1737 insertions(+), 8 deletions(-) create mode 100644 patches/0019-Add-accounts-from-other-authlib-injector-servers.patch diff --git a/README.md b/README.md index 369b282..b0d89c0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Modrinth Enhanced The [Modrinth App](https://github.com/modrinth/code), without advertising, without telemetry, and -with offline and Ely.by accounts, a skins browser and tons of fixes for Linux. +with offline, Ely.by and custom server accounts, a skins browser and tons of fixes for Linux. Everything else is deliberately left alone. This repository holds no forked source code — only a series of patches that are applied to an upstream release tag, built, and published. Whenever @@ -31,20 +31,21 @@ works. | `0016-Show-the-account-in-the-title-bar-...` | With the right sidebar folded away, the Minecraft account is shown in the title bar and managed from there. | | `0017-Start-on-Wayland-with-an-NVIDIA-GPU` | The app no longer crashes at start under Wayland with the NVIDIA driver. | | `0018-Update-from-Modrinth-Enhanced-s-...` | Updates come from this project's own signed releases rather than Modrinth's. | +| `0019-Add-accounts-from-other-...` | Sign in to Drasl, Blessing Skin and other account servers, as with Ely.by. | ### Offline accounts -"Add offline account" sits next to "Sign in to Minecraft" in the account card. It asks for a -username and nothing else. +"Offline" under "Add account" in the account card asks for a username and nothing else. The player UUID is derived exactly the way Minecraft itself derives it — an MD5 name UUID over `OfflinePlayer:` — so worlds keep the same player data when they are opened from another launcher. Offline accounts can play singleplayer and join servers running in offline mode. Servers in online mode reject them, as they do in every other launcher. -Both sit next to "Sign in to Microsoft" everywhere an account can be added: the account card, the -modal you get when pressing Play with no account, and "Sign in to Minecraft" in the getting started -checklist. Upstream offered Microsoft and nothing else at all three. +Offline, Ely.by and custom server accounts sit next to Microsoft everywhere an account can be +added: the account card, the title bar menu, the modal you get when pressing Play with no account, +and "Sign in to Minecraft" in the getting started checklist. Upstream offered Microsoft and nothing +else. ### Microsoft sign-in @@ -60,8 +61,7 @@ launcher is still one click away in the dialog, for when the browser does not wo ### Ely.by accounts -"Add Ely.by account" sits in the same account card. It asks for an Ely.by account name or email and -a password. With two-factor authentication on, append the current code to the password after a +"Ely.by" asks for an Ely.by account name or email and a password. With two-factor authentication on, append the current code to the password after a colon, which is Ely.by's own convention. At launch the game is pointed at Ely.by with @@ -75,6 +75,19 @@ read of the account list. Signing in on Ely.by's own page instead of in this form would be better, and needs an OAuth application registered with Ely.by — one has not been registered for Modrinth Enhanced. +### Custom server accounts + +"Custom server" does the same for any other server authlib-injector works with, such as +[Drasl](https://github.com/unmojang/drasl), Blessing Skin or LittleSkin. It asks for the server as +well: its website is enough, since the server names its API in the `X-Authlib-Injector-API-Location` +header. The dialog then shows the server's name and a link to sign up there. An account with several +players asks which one to play as. + +On Drasl, a player who signed up through another service uses the Minecraft token from their +account page as the password; the dialog says so. + +The account list shows which server an account is on. + ### Sidebar and news The Modrinth Servers button in the left sidebar can be switched off under diff --git a/patches/0019-Add-accounts-from-other-authlib-injector-servers.patch b/patches/0019-Add-accounts-from-other-authlib-injector-servers.patch new file mode 100644 index 0000000..c4a318e --- /dev/null +++ b/patches/0019-Add-accounts-from-other-authlib-injector-servers.patch @@ -0,0 +1,1704 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Modrinth Enhanced +Date: Thu, 17 Sep 2026 12:07:13 +0200 +Subject: [PATCH] Add accounts from other authlib-injector servers + +Ely.by is not the only account server Minecraft can be pointed at. +Drasl, Blessing Skin, LittleSkin and others speak the same Yggdrasil +protocol, and players often sign in to one run by a friend or a server +owner. A custom server sits next to the Ely.by option and asks for the +server as well. + +With a fourth way in, the account card and the title bar menu list them +under "Add account" by name alone: "Add custom server account" ran out +of the menu. + +The server is usually given as its website, which names its API in the +X-Authlib-Injector-API-Location header, the same way authlib-injector +finds it. Its metadata is read once the address is typed in, to show the +server's name and where to sign up. An account with several players signs +in as the one picked in the dialog. + +The Ely.by sign-in, renewal and launch code now serves any such server. +An account is still a row in `minecraft_users`: the server's API root +sits in the refresh token column in front of the client token, and the +account list shows which server an account is on. +--- + .../src/components/ui/AccountsCard.vue | 112 +++-- + .../src/components/ui/AuthlibAccountModal.vue | 307 +++++++++++++ + .../src/components/ui/MicrosoftLogo.vue | 8 + + .../components/ui/TitleBarAccountSwitcher.vue | 63 ++- + .../MinecraftRequiredModal.vue | 23 +- + apps/app-frontend/src/helpers/auth.js | 26 ++ + apps/app/build.rs | 2 + + apps/app/src/api/auth.rs | 27 ++ + packages/app-lib/src/api/minecraft_auth.rs | 77 +++- + packages/app-lib/src/launcher/mod.rs | 11 +- + packages/app-lib/src/state/minecraft_auth.rs | 422 ++++++++++++------ + packages/app-lib/src/util/authlib_injector.rs | 134 +++++- + 12 files changed, 1001 insertions(+), 211 deletions(-) + create mode 100644 apps/app-frontend/src/components/ui/AuthlibAccountModal.vue + create mode 100644 apps/app-frontend/src/components/ui/MicrosoftLogo.vue + +diff --git a/apps/app-frontend/src/components/ui/AccountsCard.vue b/apps/app-frontend/src/components/ui/AccountsCard.vue +index 632483e..03a61f2 100644 +--- a/apps/app-frontend/src/components/ui/AccountsCard.vue ++++ b/apps/app-frontend/src/components/ui/AccountsCard.vue +@@ -9,14 +9,23 @@ + + {{ formatMessage(messages.signInToMinecraft) }} + +- +- ++
++ ++ {{ formatMessage(messages.otherAccounts) }} ++ ++ ++ ++ ++
+ + + + +-

+- {{ account.profile.name }} +-

++
++

++ {{ account.profile.name }} ++

++ ++ {{ account.auth_server }} ++ ++
+ + + +
++ ++ {{ formatMessage(messages.addAccount) }} ++ + + ++ + +
+ +@@ -108,13 +131,14 @@ + + + ++ + + + +diff --git a/apps/app-frontend/src/components/ui/MicrosoftLogo.vue b/apps/app-frontend/src/components/ui/MicrosoftLogo.vue +new file mode 100644 +index 0000000..6d1fd75 +--- /dev/null ++++ b/apps/app-frontend/src/components/ui/MicrosoftLogo.vue +@@ -0,0 +1,8 @@ ++ +diff --git a/apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue b/apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue +index 70ab9e9..b21fae7 100644 +--- a/apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue ++++ b/apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue +@@ -22,7 +22,7 @@ + + + +@@ -88,8 +104,8 @@ +