assisweb 9.3.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +48 -23
- package/package.json +1 -1
package/index.js
CHANGED
@@ -20,29 +20,54 @@ const registerSchema = new mongoose.Schema({
|
|
20
20
|
|
21
21
|
const Accounts = mongoose.model("Accounts" , registerSchema)
|
22
22
|
|
23
|
-
|
24
|
-
MyEmail: "a",
|
25
|
-
MyPass: "a",
|
26
|
-
MyName: "a",
|
27
|
-
MyDiscordID: "a",
|
28
|
-
DiscordBotToken: "a",
|
29
|
-
ChannelID: "a",
|
30
|
-
MyID:"a"
|
31
|
-
})
|
32
|
-
Nothing.save()
|
23
|
+
|
33
24
|
module.exports = {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
25
|
+
LoginSystem : class {
|
26
|
+
constructor() {
|
27
|
+
return
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
*
|
31
|
+
* @param {Email} Email
|
32
|
+
* @param {Pass} Pass
|
33
|
+
* @param {ConsoleNot} ConsoleNot
|
34
|
+
*/
|
35
|
+
CreateUserLogin(Email, Pass , ConsoleNot) {
|
36
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
37
|
+
if(!ConsoleNot) {
|
38
|
+
if(err){
|
39
|
+
return console.log("Assis Error : Not Fond The Error")
|
40
|
+
}else {
|
41
|
+
if(data) {
|
42
|
+
if(data.MyPass.toString() === Pass) {
|
43
|
+
return true;
|
44
|
+
}else return console.log("Assis Error : Invaild Password")
|
45
|
+
}else return console.log("Assis Error : Email Is Invaild")
|
46
|
+
}
|
47
|
+
}else if (ConsoleNot === true) {
|
48
|
+
if(err){
|
49
|
+
return console.log("Assis Error : Not Fond The Error")
|
50
|
+
}else {
|
51
|
+
if(data) {
|
52
|
+
if(data.MyPass.toString() === Pass) {
|
53
|
+
return true;
|
54
|
+
}else return console.log("Assis Error : Invaild Password")
|
55
|
+
}else return console.log("Assis Error : Email Is Invaild")
|
56
|
+
}
|
57
|
+
}else if (ConsoleNot === false) {
|
58
|
+
|
59
|
+
if(err){
|
60
|
+
return;
|
61
|
+
}else {
|
62
|
+
if(data) {
|
63
|
+
if(data.MyPass.toString() === Pass) {
|
64
|
+
return true;
|
65
|
+
}else;
|
66
|
+
}else;
|
67
|
+
}
|
68
|
+
|
69
|
+
}
|
70
|
+
})
|
71
|
+
}
|
47
72
|
}
|
48
73
|
}
|