├── .eslintignore
├── .eslintrc.json
├── .github
├── FUNDING.yml
└── workflows
│ └── build.yml
├── .gitignore
├── .nvmrc
├── LICENSE.txt
├── README.md
├── app
├── app.ejs
├── assets
│ ├── css
│ │ └── launcher.css
│ ├── fonts
│ │ ├── Avenir-Black.ttf
│ │ ├── Avenir-BlackOblique.ttf
│ │ ├── Avenir-Book.ttf
│ │ ├── Avenir-BookOblique.ttf
│ │ ├── Avenir-Heavy.ttf
│ │ ├── Avenir-HeavyOblique.ttf
│ │ ├── Avenir-Light.ttf
│ │ ├── Avenir-LightOblique.ttf
│ │ ├── Avenir-Medium.ttf
│ │ ├── Avenir-MediumOblique.ttf
│ │ ├── Avenir-Oblique.ttf
│ │ ├── Avenir-Roman.ttf
│ │ └── ringbearer.ttf
│ ├── images
│ │ ├── LoadingSeal.png
│ │ ├── LoadingText.png
│ │ ├── SealCircle.ico
│ │ ├── SealCircle.png
│ │ ├── backgrounds
│ │ │ ├── 0.jpg
│ │ │ ├── 1.jpg
│ │ │ ├── 2.jpg
│ │ │ ├── 3.jpg
│ │ │ ├── 4.jpg
│ │ │ ├── 5.jpg
│ │ │ ├── 6.jpg
│ │ │ └── 7.jpg
│ │ ├── icons
│ │ │ ├── arrow.svg
│ │ │ ├── discord.svg
│ │ │ ├── instagram.svg
│ │ │ ├── link.svg
│ │ │ ├── lock.svg
│ │ │ ├── microsoft.svg
│ │ │ ├── mojang.svg
│ │ │ ├── news.svg
│ │ │ ├── profile.svg
│ │ │ ├── settings.svg
│ │ │ ├── sevenstar.svg
│ │ │ ├── sevenstar_circle.svg
│ │ │ ├── sevenstar_circle_extended.svg
│ │ │ ├── sevenstar_circle_hole.svg
│ │ │ ├── sevenstar_circle_hole_extended.svg
│ │ │ ├── sevenstar_extended.svg
│ │ │ ├── x.svg
│ │ │ └── youtube.svg
│ │ └── minecraft.icns
│ ├── js
│ │ ├── authmanager.js
│ │ ├── configmanager.js
│ │ ├── discordwrapper.js
│ │ ├── distromanager.js
│ │ ├── dropinmodutil.js
│ │ ├── ipcconstants.js
│ │ ├── isdev.js
│ │ ├── langloader.js
│ │ ├── preloader.js
│ │ ├── processbuilder.js
│ │ ├── scripts
│ │ │ ├── landing.js
│ │ │ ├── login.js
│ │ │ ├── loginOptions.js
│ │ │ ├── overlay.js
│ │ │ ├── settings.js
│ │ │ ├── uibinder.js
│ │ │ ├── uicore.js
│ │ │ └── welcome.js
│ │ └── serverstatus.js
│ └── lang
│ │ ├── _custom.toml
│ │ └── en_US.toml
├── frame.ejs
├── landing.ejs
├── login.ejs
├── loginOptions.ejs
├── overlay.ejs
├── settings.ejs
├── waiting.ejs
└── welcome.ejs
├── build
└── icon.png
├── dev-app-update.yml
├── docs
├── MicrosoftAuth.md
├── distro.md
└── sample_distribution.json
├── electron-builder.yml
├── index.js
├── libraries
└── java
│ └── PackXZExtract.jar
├── package-lock.json
└── package.json
/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "es2022": true,
4 | "node": true
5 | },
6 | "extends": "eslint:recommended",
7 | "parserOptions": {
8 | "ecmaVersion": 2022,
9 | "sourceType": "module"
10 | },
11 | "rules": {
12 | "indent": [
13 | "error",
14 | 4,
15 | {
16 | "SwitchCase": 1
17 | }
18 | ],
19 | "linebreak-style": [
20 | "error",
21 | "windows"
22 | ],
23 | "quotes": [
24 | "error",
25 | "single"
26 | ],
27 | "semi": [
28 | "error",
29 | "never"
30 | ],
31 | "no-var": [
32 | "error"
33 | ],
34 | "no-console": [
35 | 0
36 | ],
37 | "no-control-regex": [
38 | 0
39 | ],
40 | "no-unused-vars": [
41 | "error",
42 | {
43 | "vars": "all",
44 | "args": "none",
45 | "ignoreRestSiblings": false,
46 | "argsIgnorePattern": "reject"
47 | }
48 | ],
49 | "no-async-promise-executor": [
50 | 0
51 | ]
52 | },
53 | "overrides": [
54 | {
55 | "files": [ "app/assets/js/scripts/*.js" ],
56 | "rules": {
57 | "no-unused-vars": [
58 | 0
59 | ],
60 | "no-undef": [
61 | 0
62 | ]
63 | }
64 | }
65 | ]
66 | }
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: dscalzi
2 | patreon: dscalzi
3 | custom: ['https://www.paypal.me/dscalzi']
4 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on: push
4 |
5 | jobs:
6 | release:
7 | runs-on: ${{ matrix.os }}
8 |
9 | permissions:
10 | contents: write
11 |
12 | strategy:
13 | matrix:
14 | os: [macos-latest, ubuntu-latest, windows-latest]
15 |
16 | steps:
17 | - name: Check out Git repository
18 | uses: actions/checkout@v3
19 |
20 | - name: Set up Node
21 | uses: actions/setup-node@v3
22 | with:
23 | node-version: 20
24 |
25 | - name: Set up Python
26 | uses: actions/setup-python@v4
27 | with:
28 | python-version: 3.x
29 |
30 | - name: Install Dependencies
31 | run: npm ci
32 | shell: bash
33 |
34 | - name: Build
35 | env:
36 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 | run: npm run dist
38 | shell: bash
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 | /.vs/
3 | /.vscode/
4 | /target/
5 | /logs/
6 | /dist/
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 20
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017-2024 Daniel D. Scalzi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |

2 |
3 | Helios Launcher
4 |
5 | (formerly Electron Launcher)
6 |
7 | [
](https://github.com/dscalzi/HeliosLauncher/actions) [
](https://github.com/dscalzi/HeliosLauncher/releases) 
8 |
9 | Join modded servers without worrying about installing Java, Forge, or other mods. We'll handle that for you.
10 |
11 | 
12 | 
13 |
14 | ## Features
15 |
16 | * 🔒 Full account management.
17 | * Add multiple accounts and easily switch between them.
18 | * Microsoft (OAuth 2.0) + Mojang (Yggdrasil) authentication fully supported.
19 | * Credentials are never stored and transmitted directly to Mojang.
20 | * 📂 Efficient asset management.
21 | * Receive client updates as soon as we release them.
22 | * Files are validated before launch. Corrupt or incorrect files will be redownloaded.
23 | * ☕ **Automatic Java validation.**
24 | * If you have an incompatible version of Java installed, we'll install the right one *for you*.
25 | * You do not need to have Java installed to run the launcher.
26 | * 📰 News feed natively built into the launcher.
27 | * ⚙️ Intuitive settings management, including a Java control panel.
28 | * Supports all of our servers.
29 | * Switch between server configurations with ease.
30 | * View the player count of the selected server.
31 | * Automatic updates. That's right, the launcher updates itself.
32 | * View the status of Mojang's services.
33 |
34 | This is not an exhaustive list. Download and install the launcher to gauge all it can do!
35 |
36 | #### Need Help? [Check the wiki.][wiki]
37 |
38 | #### Like the project? Leave a ⭐ star on the repository!
39 |
40 | ## Downloads
41 |
42 | You can download from [GitHub Releases](https://github.com/dscalzi/HeliosLauncher/releases)
43 |
44 | #### Latest Release
45 |
46 | [](https://github.com/dscalzi/HeliosLauncher/releases/latest)
47 |
48 | #### Latest Pre-Release
49 | [](https://github.com/dscalzi/HeliosLauncher/releases)
50 |
51 | **Supported Platforms**
52 |
53 | If you download from the [Releases](https://github.com/dscalzi/HeliosLauncher/releases) tab, select the installer for your system.
54 |
55 | | Platform | File |
56 | | -------- | ---- |
57 | | Windows x64 | `Helios-Launcher-setup-VERSION.exe` |
58 | | macOS x64 | `Helios-Launcher-setup-VERSION-x64.dmg` |
59 | | macOS arm64 | `Helios-Launcher-setup-VERSION-arm64.dmg` |
60 | | Linux x64 | `Helios-Launcher-setup-VERSION.AppImage` |
61 |
62 | ## Console
63 |
64 | To open the console, use the following keybind.
65 |
66 | ```console
67 | ctrl + shift + i
68 | ```
69 |
70 | Ensure that you have the console tab selected. Do not paste anything into the console unless you are 100% sure of what it will do. Pasting the wrong thing can expose sensitive information.
71 |
72 | #### Export Output to a File
73 |
74 | If you want to export the console output, simply right click anywhere on the console and click **Save as..**
75 |
76 | 
77 |
78 |
79 | ## Development
80 |
81 | This section details the setup of a basic developmentment environment.
82 |
83 | ### Getting Started
84 |
85 | **System Requirements**
86 |
87 | * [Node.js][nodejs] v20
88 |
89 | ---
90 |
91 | **Clone and Install Dependencies**
92 |
93 | ```console
94 | > git clone https://github.com/dscalzi/HeliosLauncher.git
95 | > cd HeliosLauncher
96 | > npm install
97 | ```
98 |
99 | ---
100 |
101 | **Launch Application**
102 |
103 | ```console
104 | > npm start
105 | ```
106 |
107 | ---
108 |
109 | **Build Installers**
110 |
111 | To build for your current platform.
112 |
113 | ```console
114 | > npm run dist
115 | ```
116 |
117 | Build for a specific platform.
118 |
119 | | Platform | Command |
120 | | ----------- | -------------------- |
121 | | Windows x64 | `npm run dist:win` |
122 | | macOS | `npm run dist:mac` |
123 | | Linux x64 | `npm run dist:linux` |
124 |
125 | Builds for macOS may not work on Windows/Linux and vice-versa.
126 |
127 | ---
128 |
129 | ### Visual Studio Code
130 |
131 | All development of the launcher should be done using [Visual Studio Code][vscode].
132 |
133 | Paste the following into `.vscode/launch.json`
134 |
135 | ```JSON
136 | {
137 | "version": "0.2.0",
138 | "configurations": [
139 | {
140 | "name": "Debug Main Process",
141 | "type": "node",
142 | "request": "launch",
143 | "cwd": "${workspaceFolder}",
144 | "program": "${workspaceFolder}/node_modules/electron/cli.js",
145 | "args" : ["."],
146 | "outputCapture": "std"
147 | },
148 | {
149 | "name": "Debug Renderer Process",
150 | "type": "chrome",
151 | "request": "launch",
152 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
153 | "windows": {
154 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
155 | },
156 | "runtimeArgs": [
157 | "${workspaceFolder}/.",
158 | "--remote-debugging-port=9222"
159 | ],
160 | "webRoot": "${workspaceFolder}"
161 | }
162 | ]
163 | }
164 | ```
165 |
166 | This adds two debug configurations.
167 |
168 | #### Debug Main Process
169 |
170 | This allows you to debug Electron's [main process][mainprocess]. You can debug scripts in the [renderer process][rendererprocess] by opening the DevTools Window.
171 |
172 | #### Debug Renderer Process
173 |
174 | This allows you to debug Electron's [renderer process][rendererprocess]. This requires you to install the [Debugger for Chrome][chromedebugger] extension.
175 |
176 | Note that you **cannot** open the DevTools window while using this debug configuration. Chromium only allows one debugger, opening another will crash the program.
177 |
178 | ---
179 |
180 | ### Note on Third-Party Usage
181 |
182 | Please give credit to the original author and provide a link to the original source. This is free software, please do at least this much.
183 |
184 | For instructions on setting up Microsoft Authentication, see https://github.com/dscalzi/HeliosLauncher/blob/master/docs/MicrosoftAuth.md.
185 |
186 | ---
187 |
188 | ## Resources
189 |
190 | * [Wiki][wiki]
191 | * [Nebula (Create Distribution.json)][nebula]
192 | * [v2 Rewrite Branch (Inactive)][v2branch]
193 |
194 | The best way to contact the developers is on Discord.
195 |
196 | [][discord]
197 |
198 | ---
199 |
200 | ### See you ingame.
201 |
202 |
203 | [nodejs]: https://nodejs.org/en/ 'Node.js'
204 | [vscode]: https://code.visualstudio.com/ 'Visual Studio Code'
205 | [mainprocess]: https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes 'Main Process'
206 | [rendererprocess]: https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes 'Renderer Process'
207 | [chromedebugger]: https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome 'Debugger for Chrome'
208 | [discord]: https://discord.gg/zNWUXdt 'Discord'
209 | [wiki]: https://github.com/dscalzi/HeliosLauncher/wiki 'wiki'
210 | [nebula]: https://github.com/dscalzi/Nebula 'dscalzi/Nebula'
211 | [v2branch]: https://github.com/dscalzi/HeliosLauncher/tree/ts-refactor 'v2 branch'
212 |
--------------------------------------------------------------------------------
/app/app.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= lang('app.title') %>
5 |
6 |
7 |
8 |
28 |
29 |
30 | <%- include('frame') %>
31 |
32 | <%- include('welcome') %>
33 | <%- include('login') %>
34 | <%- include('waiting') %>
35 | <%- include('loginOptions') %>
36 | <%- include('settings') %>
37 | <%- include('landing') %>
38 |
39 | <%- include('overlay') %>
40 |
41 |
42 |
43 |

44 |

45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-Black.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-BlackOblique.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-BlackOblique.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-Book.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-Book.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-BookOblique.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-BookOblique.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-Heavy.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-Heavy.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-HeavyOblique.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-HeavyOblique.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-Light.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-LightOblique.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-LightOblique.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-Medium.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-MediumOblique.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-MediumOblique.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-Oblique.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-Oblique.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/Avenir-Roman.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/Avenir-Roman.ttf
--------------------------------------------------------------------------------
/app/assets/fonts/ringbearer.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/fonts/ringbearer.ttf
--------------------------------------------------------------------------------
/app/assets/images/LoadingSeal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/LoadingSeal.png
--------------------------------------------------------------------------------
/app/assets/images/LoadingText.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/LoadingText.png
--------------------------------------------------------------------------------
/app/assets/images/SealCircle.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/SealCircle.ico
--------------------------------------------------------------------------------
/app/assets/images/SealCircle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/SealCircle.png
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/0.jpg
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/1.jpg
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/2.jpg
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/3.jpg
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/4.jpg
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/5.jpg
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/6.jpg
--------------------------------------------------------------------------------
/app/assets/images/backgrounds/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/backgrounds/7.jpg
--------------------------------------------------------------------------------
/app/assets/images/icons/arrow.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/discord.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/instagram.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/assets/images/icons/link.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/lock.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/microsoft.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/mojang.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/news.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/profile.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/settings.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/sevenstar.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/sevenstar_circle.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/sevenstar_circle_extended.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/sevenstar_circle_hole.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/sevenstar_circle_hole_extended.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/sevenstar_extended.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/icons/x.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/assets/images/icons/youtube.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/minecraft.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dscalzi/HeliosLauncher/f8b7b9251c2d50ea06c8c9c6b63ea4ad05630644/app/assets/images/minecraft.icns
--------------------------------------------------------------------------------
/app/assets/js/authmanager.js:
--------------------------------------------------------------------------------
1 | /**
2 | * AuthManager
3 | *
4 | * This module aims to abstract login procedures. Results from Mojang's REST api
5 | * are retrieved through our Mojang module. These results are processed and stored,
6 | * if applicable, in the config using the ConfigManager. All login procedures should
7 | * be made through this module.
8 | *
9 | * @module authmanager
10 | */
11 | // Requirements
12 | const ConfigManager = require('./configmanager')
13 | const { LoggerUtil } = require('helios-core')
14 | const { RestResponseStatus } = require('helios-core/common')
15 | const { MojangRestAPI, MojangErrorCode } = require('helios-core/mojang')
16 | const { MicrosoftAuth, MicrosoftErrorCode } = require('helios-core/microsoft')
17 | const { AZURE_CLIENT_ID } = require('./ipcconstants')
18 | const Lang = require('./langloader')
19 |
20 | const log = LoggerUtil.getLogger('AuthManager')
21 |
22 | // Error messages
23 |
24 | function microsoftErrorDisplayable(errorCode) {
25 | switch (errorCode) {
26 | case MicrosoftErrorCode.NO_PROFILE:
27 | return {
28 | title: Lang.queryJS('auth.microsoft.error.noProfileTitle'),
29 | desc: Lang.queryJS('auth.microsoft.error.noProfileDesc')
30 | }
31 | case MicrosoftErrorCode.NO_XBOX_ACCOUNT:
32 | return {
33 | title: Lang.queryJS('auth.microsoft.error.noXboxAccountTitle'),
34 | desc: Lang.queryJS('auth.microsoft.error.noXboxAccountDesc')
35 | }
36 | case MicrosoftErrorCode.XBL_BANNED:
37 | return {
38 | title: Lang.queryJS('auth.microsoft.error.xblBannedTitle'),
39 | desc: Lang.queryJS('auth.microsoft.error.xblBannedDesc')
40 | }
41 | case MicrosoftErrorCode.UNDER_18:
42 | return {
43 | title: Lang.queryJS('auth.microsoft.error.under18Title'),
44 | desc: Lang.queryJS('auth.microsoft.error.under18Desc')
45 | }
46 | case MicrosoftErrorCode.UNKNOWN:
47 | return {
48 | title: Lang.queryJS('auth.microsoft.error.unknownTitle'),
49 | desc: Lang.queryJS('auth.microsoft.error.unknownDesc')
50 | }
51 | }
52 | }
53 |
54 | function mojangErrorDisplayable(errorCode) {
55 | switch(errorCode) {
56 | case MojangErrorCode.ERROR_METHOD_NOT_ALLOWED:
57 | return {
58 | title: Lang.queryJS('auth.mojang.error.methodNotAllowedTitle'),
59 | desc: Lang.queryJS('auth.mojang.error.methodNotAllowedDesc')
60 | }
61 | case MojangErrorCode.ERROR_NOT_FOUND:
62 | return {
63 | title: Lang.queryJS('auth.mojang.error.notFoundTitle'),
64 | desc: Lang.queryJS('auth.mojang.error.notFoundDesc')
65 | }
66 | case MojangErrorCode.ERROR_USER_MIGRATED:
67 | return {
68 | title: Lang.queryJS('auth.mojang.error.accountMigratedTitle'),
69 | desc: Lang.queryJS('auth.mojang.error.accountMigratedDesc')
70 | }
71 | case MojangErrorCode.ERROR_INVALID_CREDENTIALS:
72 | return {
73 | title: Lang.queryJS('auth.mojang.error.invalidCredentialsTitle'),
74 | desc: Lang.queryJS('auth.mojang.error.invalidCredentialsDesc')
75 | }
76 | case MojangErrorCode.ERROR_RATELIMIT:
77 | return {
78 | title: Lang.queryJS('auth.mojang.error.tooManyAttemptsTitle'),
79 | desc: Lang.queryJS('auth.mojang.error.tooManyAttemptsDesc')
80 | }
81 | case MojangErrorCode.ERROR_INVALID_TOKEN:
82 | return {
83 | title: Lang.queryJS('auth.mojang.error.invalidTokenTitle'),
84 | desc: Lang.queryJS('auth.mojang.error.invalidTokenDesc')
85 | }
86 | case MojangErrorCode.ERROR_ACCESS_TOKEN_HAS_PROFILE:
87 | return {
88 | title: Lang.queryJS('auth.mojang.error.tokenHasProfileTitle'),
89 | desc: Lang.queryJS('auth.mojang.error.tokenHasProfileDesc')
90 | }
91 | case MojangErrorCode.ERROR_CREDENTIALS_MISSING:
92 | return {
93 | title: Lang.queryJS('auth.mojang.error.credentialsMissingTitle'),
94 | desc: Lang.queryJS('auth.mojang.error.credentialsMissingDesc')
95 | }
96 | case MojangErrorCode.ERROR_INVALID_SALT_VERSION:
97 | return {
98 | title: Lang.queryJS('auth.mojang.error.invalidSaltVersionTitle'),
99 | desc: Lang.queryJS('auth.mojang.error.invalidSaltVersionDesc')
100 | }
101 | case MojangErrorCode.ERROR_UNSUPPORTED_MEDIA_TYPE:
102 | return {
103 | title: Lang.queryJS('auth.mojang.error.unsupportedMediaTypeTitle'),
104 | desc: Lang.queryJS('auth.mojang.error.unsupportedMediaTypeDesc')
105 | }
106 | case MojangErrorCode.ERROR_GONE:
107 | return {
108 | title: Lang.queryJS('auth.mojang.error.accountGoneTitle'),
109 | desc: Lang.queryJS('auth.mojang.error.accountGoneDesc')
110 | }
111 | case MojangErrorCode.ERROR_UNREACHABLE:
112 | return {
113 | title: Lang.queryJS('auth.mojang.error.unreachableTitle'),
114 | desc: Lang.queryJS('auth.mojang.error.unreachableDesc')
115 | }
116 | case MojangErrorCode.ERROR_NOT_PAID:
117 | return {
118 | title: Lang.queryJS('auth.mojang.error.gameNotPurchasedTitle'),
119 | desc: Lang.queryJS('auth.mojang.error.gameNotPurchasedDesc')
120 | }
121 | case MojangErrorCode.UNKNOWN:
122 | return {
123 | title: Lang.queryJS('auth.mojang.error.unknownErrorTitle'),
124 | desc: Lang.queryJS('auth.mojang.error.unknownErrorDesc')
125 | }
126 | default:
127 | throw new Error(`Unknown error code: ${errorCode}`)
128 | }
129 | }
130 |
131 | // Functions
132 |
133 | /**
134 | * Add a Mojang account. This will authenticate the given credentials with Mojang's
135 | * authserver. The resultant data will be stored as an auth account in the
136 | * configuration database.
137 | *
138 | * @param {string} username The account username (email if migrated).
139 | * @param {string} password The account password.
140 | * @returns {Promise.