jascaldeira / AOE4-DISCORD-BOT

4 stars 2 forks source link

Signup with a new account, erasing old user information #11

Open sof75 opened 1 year ago

sof75 commented 1 year ago

Hello, I think that your code need to have a corrected signup insertion, when someone is registering with a new account (after he was already registered)

Usecase : lost/stolen account, smurfing account, changing between xbox game pass to steam, ... Problem : today, when the discord player is trying to sign up with his new aoe4 account, it doesn't work and still show the previous aoe4 account Priority : very low

so it seems the problem is located at this line (in commands/signup.js) :

con.query(INSERT INTO users (discord_user_id, aoe4_world_id, discord_guild_id, last_game_checkup_at) VALUES (+ userID +, '+ sanitizedAOE4WorldID +', '+ guildID +', '+ currentTimestamp +') ON DUPLICATE KEY UPDATE aoe4_world_id='+ sanitizedAOE4WorldID +', (userErr, result) => { });

it need something like erasing the previous user's information in the DB before inserting the new infos ?

Maybe create a command to erase the user info on your server (eraseuser.js ?) and call it here before inserting the new information ? (it could be RGPD compliant too btw!)

Thanks for the work 💯

jascaldeira commented 1 year ago

Thank you for your suggestion, what you say makes total sense, just need to check how to make it, in order to people dont signup with other's accounts just "for fun" messing around things.