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 | 334 ++++++++++++++ .../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 | 138 +++++- 12 files changed, 1032 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 @@