assisweb 9.5.0 → 12.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +64 -14
- package/package.json +1 -1
package/index.js
CHANGED
@@ -22,18 +22,68 @@ const Accounts = mongoose.model("Accounts" , registerSchema)
|
|
22
22
|
|
23
23
|
|
24
24
|
module.exports = {
|
25
|
-
|
26
|
-
|
27
|
-
if(
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
25
|
+
CreateUserLogin : function(Email, Pass , ConsoleNot) {
|
26
|
+
// ConNot Not Found
|
27
|
+
if(!ConsoleNot) {
|
28
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
29
|
+
if(err) {
|
30
|
+
return console.log("Assis Error : Not Found Error")
|
31
|
+
}
|
32
|
+
if(data) {
|
33
|
+
if(data.MyPass.toString === Pass) {
|
34
|
+
return true
|
35
|
+
}else {
|
36
|
+
console.log("Assis Error : Password Is Invaild")
|
37
|
+
return false
|
38
|
+
}
|
39
|
+
}else return console.log("Assis Error : Invaild Email")
|
40
|
+
})
|
41
|
+
//ConNot true
|
42
|
+
}else if(ConsoleNot === true) {
|
43
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
44
|
+
if(err) {
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
if(data) {
|
48
|
+
if(data.MyPass.toString === Pass) {
|
49
|
+
return true
|
50
|
+
}else {
|
51
|
+
return false
|
52
|
+
}
|
53
|
+
}else return;
|
54
|
+
})
|
55
|
+
//ContNot false
|
56
|
+
}else if(ConsoleNot === false) {
|
57
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
58
|
+
if(err) {
|
59
|
+
return console.log("Assis Error : Not Found Error")
|
60
|
+
}
|
61
|
+
if(data) {
|
62
|
+
if(data.MyPass.toString === Pass) {
|
63
|
+
return true
|
64
|
+
}else {
|
65
|
+
console.log("Assis Error : Password Is Invaild")
|
66
|
+
return false
|
67
|
+
}
|
68
|
+
}else return console.log("Assis Error : Invaild Email")
|
69
|
+
})
|
70
|
+
}else return console.log("Assis Error : 'Email','Password','true Or false' ")
|
71
|
+
},
|
72
|
+
|
73
|
+
|
74
|
+
Data(Email , Pass) {
|
75
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
76
|
+
if(err) {
|
77
|
+
return;
|
78
|
+
}
|
79
|
+
if(data) {
|
80
|
+
return data.MyName.toString()
|
81
|
+
}else return console.log("Assis Error : Email is Invaild")
|
82
|
+
})
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
39
89
|
}
|