updateAuthAccountWithMicrosoftに名前を変更

This commit is contained in:
ReyADayer 2021-03-01 16:25:44 +09:00
parent e8ab6585db
commit 0708b8fa7b
2 changed files with 3 additions and 3 deletions

View File

@ -54,12 +54,12 @@ async function validateSelectedMicrosoft() {
if (MSExpired) { if (MSExpired) {
const newAccessToken = await Microsoft.refreshAccessToken(current.microsoft.refresh_token) const newAccessToken = await Microsoft.refreshAccessToken(current.microsoft.refresh_token)
const newMCAccessToken = await Microsoft.authMinecraft(newAccessToken.access_token) const newMCAccessToken = await Microsoft.authMinecraft(newAccessToken.access_token)
ConfigManager.updateAuthAccount(current.uuid, newMCAccessToken.access_token, newAccessToken.expires_at) ConfigManager.updateAuthAccountWithMicrosoft(current.uuid, newMCAccessToken.access_token, newAccessToken.expires_at)
ConfigManager.save() ConfigManager.save()
return true return true
} }
const newMCAccessToken = await Microsoft.authMinecraft(current.microsoft.access_token) const newMCAccessToken = await Microsoft.authMinecraft(current.microsoft.access_token)
ConfigManager.updateAuthAccount(current.uuid, newMCAccessToken.access_token, current.microsoft.access_token, current.microsoft.expires_at, newMCAccessToken.expires_at) ConfigManager.updateAuthAccountWithMicrosoft(current.uuid, newMCAccessToken.access_token, current.microsoft.access_token, current.microsoft.expires_at, newMCAccessToken.expires_at)
ConfigManager.save() ConfigManager.save()
return true return true

View File

@ -341,7 +341,7 @@ exports.updateAuthAccount = function(uuid, accessToken){
* *
* @returns {Object} The authenticated account object created by this action. * @returns {Object} The authenticated account object created by this action.
*/ */
exports.updateAuthAccount = function(uuid, accessToken, msAccessToken, msRefreshToken, msExpires, mcExpires){ exports.updateAuthAccountWithMicrosoft = function(uuid, accessToken, msAccessToken, msRefreshToken, msExpires, mcExpires){
config.authenticationDatabase[uuid].accessToken = accessToken config.authenticationDatabase[uuid].accessToken = accessToken
config.authenticationDatabase[uuid].expiresAt = mcExpires config.authenticationDatabase[uuid].expiresAt = mcExpires
config.authenticationDatabase[uuid].microsoft.access_token = msAccessToken config.authenticationDatabase[uuid].microsoft.access_token = msAccessToken