mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-03-21 17:44:49 -05:00
Only store Discord user ID
This commit is contained in:
parent
da9b2f66fe
commit
0caa1b9b66
|
|
@ -183,7 +183,7 @@ async function addUserConnection(pnid, data, type) {
|
|||
}
|
||||
|
||||
async function addUserConnectionDiscord(pnid, data) {
|
||||
if (!data.id || !data.access_token || !data.refresh_token) {
|
||||
if (!data.id) {
|
||||
return {
|
||||
app: 'api',
|
||||
status: 400,
|
||||
|
|
@ -213,9 +213,7 @@ async function removeUserConnection(pnid, type) {
|
|||
async function removeUserConnectionDiscord(pnid) {
|
||||
await PNID.updateOne({ pid: pnid.get('pid') }, {
|
||||
$set: {
|
||||
'connections.discord.id': '',
|
||||
'connections.discord.access_token': '',
|
||||
'connections.discord.refresh_token': ''
|
||||
'connections.discord.id': ''
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -100,9 +100,7 @@ const PNIDSchema = new Schema({
|
|||
},
|
||||
connections: {
|
||||
discord: {
|
||||
id: String,
|
||||
access_token: String,
|
||||
refresh_token: String,
|
||||
id: String
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const router = require('express').Router();
|
||||
const { PNID } = require('./models/pnid');
|
||||
const { PNID } = require('../../../../models/pnid');
|
||||
|
||||
/**
|
||||
* [GET]
|
||||
|
|
@ -43,9 +43,7 @@ router.get('/', async (request, response) => {
|
|||
},
|
||||
connections: {
|
||||
discord: {
|
||||
id: pnid.get('connections.discord.id'),
|
||||
access_token: pnid.get('connections.discord.access_token'),
|
||||
refresh_token: pnid.get('connections.discord.refresh_token'),
|
||||
id: pnid.get('connections.discord.id')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -99,9 +97,7 @@ router.post('/', async (request, response) => {
|
|||
},
|
||||
connections: {
|
||||
discord: {
|
||||
id: pnid.get('connections.discord.id'),
|
||||
access_token: pnid.get('connections.discord.access_token'),
|
||||
refresh_token: pnid.get('connections.discord.refresh_token'),
|
||||
id: pnid.get('connections.discord.id')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user