Versiion 0.2.3 - Ajout Handle Case Discriminator
This commit is contained in:
parent
f567c23ecc
commit
5284c1fadd
@ -5,7 +5,7 @@
|
|||||||
"access_token": "jY17lCWaOpTdPQCnz50kfNm7ABpsGz",
|
"access_token": "jY17lCWaOpTdPQCnz50kfNm7ABpsGz",
|
||||||
"expires_in": 604800,
|
"expires_in": 604800,
|
||||||
"refresh_token": "3TronknZ7j5kVSDBjI3OechmCYF8ck",
|
"refresh_token": "3TronknZ7j5kVSDBjI3OechmCYF8ck",
|
||||||
"scope": "guilds guilds.members.read identify"
|
"scope": "identify guilds guilds.members.read"
|
||||||
},
|
},
|
||||||
"avatar": null,
|
"avatar": null,
|
||||||
"communication_disabled_until": null,
|
"communication_disabled_until": null,
|
||||||
@ -34,6 +34,6 @@
|
|||||||
"deaf": false,
|
"deaf": false,
|
||||||
"bio": "",
|
"bio": "",
|
||||||
"banner": null,
|
"banner": null,
|
||||||
"token": "289373d4-8733-484b-b674-2230e0afc6ae"
|
"token": "7149b971-4595-496c-a541-4c687a37ffd6"
|
||||||
}
|
}
|
||||||
]
|
]
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "subsonics-web",
|
"name": "subsonics-web",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "subsonics-web",
|
"name": "subsonics-web",
|
||||||
"author": "Raphix",
|
"author": "Raphix",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ext": "js, html",
|
"ext": "js, html",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
@ -74,6 +74,11 @@ module.exports.getDiscordUser = function (code, session) {
|
|||||||
|
|
||||||
var user = {}
|
var user = {}
|
||||||
|
|
||||||
|
if(userInfo.user.discriminator) {
|
||||||
|
reject("MIGRATE_ACCOUNT_ONLY")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
user.auth = authorizationKey
|
user.auth = authorizationKey
|
||||||
Object.assign(user, userInfo)
|
Object.assign(user, userInfo)
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ router.get('/redirect', function(req, res, next) {
|
|||||||
|
|
||||||
if(req.query.code) {
|
if(req.query.code) {
|
||||||
|
|
||||||
alog.step.init("get_discord_info_" + req.cookies.session , "Récupération des informations de l'utilisateur associé à l'autorisation : '" + req.cookies.sessionn + "'")
|
alog.step.init("get_discord_info_" + req.cookies.session , "Récupération des informations de l'utilisateur associé à l'autorisation : '" + req.cookies.session + "'")
|
||||||
|
|
||||||
const user = auth.getDiscordUser(req.query.code, req.cookies.session)
|
const user = auth.getDiscordUser(req.query.code, req.cookies.session)
|
||||||
|
|
||||||
@ -43,8 +43,18 @@ router.get('/redirect', function(req, res, next) {
|
|||||||
|
|
||||||
alog.step.error("get_discord_info_" + req.cookies.session)
|
alog.step.error("get_discord_info_" + req.cookies.session)
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
||||||
|
if(error == "MIGRATE_ACCOUNT_ONLY") {
|
||||||
|
|
||||||
|
res.redirect('/login?error=MIGRATE_ACCOUNT_ONLY')
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
res.redirect('/login?error=CANCEL_LOGIN')
|
res.redirect('/login?error=CANCEL_LOGIN')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user