mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-10 15:54:49 +08:00
verify is redirecting to pagetest
verify is checking if account is already paired
This commit is contained in:
parent
1f2a3aef35
commit
3921a63b04
2 changed files with 18 additions and 0 deletions
|
@ -867,6 +867,23 @@ exports.verifyUser = functions.https.onRequest(async (request, response) => {
|
|||
.then((res) => res.json())
|
||||
.then(async (res2) => {
|
||||
let did = res2.id;
|
||||
|
||||
if (
|
||||
(await db.collection("users").where("discordId", "==", did).get())
|
||||
.docs.length > 0
|
||||
) {
|
||||
response
|
||||
.status(200)
|
||||
.send({
|
||||
data: {
|
||||
status: -1,
|
||||
message:
|
||||
"This Discord account is already paired to a different Monkeytype account",
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await db.collection("users").doc(request.uid).update({
|
||||
discordId: did,
|
||||
});
|
||||
|
|
|
@ -5655,6 +5655,7 @@ let mappedRoutes = {
|
|||
"/settings": "pageSettings",
|
||||
"/about": "pageAbout",
|
||||
"/account": "pageAccount",
|
||||
"/verify": "pageTest",
|
||||
};
|
||||
|
||||
function handleInitialPageClasses(el) {
|
||||
|
|
Loading…
Reference in a new issue