Microsoftログイン機能のためのClient idを追加

This commit is contained in:
ReyADayer 2021-02-07 05:08:24 +09:00
parent 8c65a031fe
commit 0b3da33cde
8 changed files with 4057 additions and 22 deletions

1
.env.sample Normal file
View File

@ -0,0 +1 @@
AZURE_CLIENT_ID=client_id_here

4
.gitignore vendored
View File

@ -3,4 +3,6 @@
/.vscode/
/target/
/logs/
/dist/
/dist/
.env

View File

@ -1,8 +1,10 @@
require('dotenv').config()
// Requirements
const request = require('request')
// Constants
const clientId = 'client id here'
const clientId = process.env.AZURE_CLIENT_ID
const tokenUri = 'https://login.microsoftonline.com/consumers/oauth2/v2.0/token'
const authXBLUri = 'https://user.auth.xboxlive.com/user/authenticate'
@ -78,7 +80,7 @@ function getXSTSToken(XBLToken) {
case 2148916238:
reject({
message: 'Since you are not yet 18 years old, an adult must add you to a family in order for you to use Helios Launcher!'
message: 'Since you are not yet 18 years old, an adult must add you to a family in order for you to use NumaLauncher!'
})
return

View File

@ -323,7 +323,7 @@ ipcRenderer.on('MSALoginWindowReply', (event, ...args) => {
return
}
case 'AuthNotFinished': {
setOverlayContent('ERROR', 'You have to finish the login process to use Helios Launcher. The window will close by itself when you have successfully logged in.', 'OK')
setOverlayContent('ERROR', 'You have to finish the login process to use NumaLauncher. The window will close by itself when you have successfully logged in.', 'OK')
setOverlayHandler(() => {
toggleOverlay(false)
toggleOverlay(false, false, 'msOverlay')

View File

@ -7,7 +7,7 @@
</div>
<div id="loginContent">
<form id="loginForm">
<img id="loginImageSeal" src="assets/images/SealCircle.png" />
<img id="loginImageSeal" src="assets/images/SealCircle.svg" />
<span id="loginSubheader">MINECRAFTへログイン</span>
<div class="loginFieldContainer">
<svg id="profileSVG" class="loginSVG" viewBox="40 37 65.36 61.43">

View File

@ -1,3 +1,5 @@
require('dotenv').config()
// Requirements
const { app, BrowserWindow, ipcMain, Menu, shell } = require('electron')
const autoUpdater = require('electron-updater').autoUpdater
@ -9,7 +11,7 @@ const semver = require('semver')
const url = require('url')
const redirectUriPrefix = 'https://login.microsoftonline.com/common/oauth2/nativeclient?'
const clientID = 'client id here'
const clientID = process.env.AZURE_CLIENT_ID
// Setup auto updater.
function initAutoUpdater(event, data) {
@ -133,6 +135,7 @@ ipcMain.on('openMSALoginWindow', (ipcEvent, args) => {
})
MSALoginWindow.removeMenu()
console.log(clientID)
MSALoginWindow.loadURL('https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?prompt=consent&client_id=' + clientID + '&response_type=code&scope=XboxLive.signin%20offline_access&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient')
})

4058
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@
"adm-zip": "^0.5.1",
"async": "^3.2.0",
"discord-rpc": "^3.1.4",
"dotenv": "^8.2.0",
"ejs": "^3.1.5",
"ejs-electron": "^2.1.1",
"electron-updater": "^4.3.5",