assisweb 9.5.0 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +47 -13
- package/package.json +1 -1
package/index.js
CHANGED
@@ -22,18 +22,52 @@ const Accounts = mongoose.model("Accounts" , registerSchema)
|
|
22
22
|
|
23
23
|
|
24
24
|
module.exports = {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
+
}
|
38
72
|
}
|
39
73
|
}
|