assisweb 10.0.0 → 11.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 +68 -30
- package/package.json +1 -1
package/index.js
CHANGED
@@ -22,7 +22,8 @@ const Accounts = mongoose.model("Accounts" , registerSchema)
|
|
22
22
|
|
23
23
|
|
24
24
|
module.exports = {
|
25
|
-
|
25
|
+
//System
|
26
|
+
System : class {
|
26
27
|
constructor() {
|
27
28
|
return
|
28
29
|
}
|
@@ -33,41 +34,78 @@ module.exports = {
|
|
33
34
|
* @param {ConsoleNot} ConsoleNot
|
34
35
|
*/
|
35
36
|
CreateUserLogin(Email, Pass , ConsoleNot) {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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")
|
37
|
+
// ConNot Not Found
|
38
|
+
if(!ConsoleNot) {
|
39
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
40
|
+
if(err) {
|
41
|
+
return console.log("Assis Error : Not Found Error")
|
56
42
|
}
|
57
|
-
|
58
|
-
|
59
|
-
|
43
|
+
if(data) {
|
44
|
+
if(data.MyPass.toString === Pass) {
|
45
|
+
return true
|
46
|
+
}else {
|
47
|
+
console.log("Assis Error : Password Is Invaild")
|
48
|
+
return false
|
49
|
+
}
|
50
|
+
}else return console.log("Assis Error : Invaild Email")
|
51
|
+
})
|
52
|
+
//ConNot true
|
53
|
+
}else if(ConsoleNot === true) {
|
54
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
55
|
+
if(err) {
|
60
56
|
return;
|
61
|
-
}else {
|
62
|
-
if(data) {
|
63
|
-
if(data.MyPass.toString() === Pass) {
|
64
|
-
return true;
|
65
|
-
}else;
|
66
|
-
}else;
|
67
57
|
}
|
58
|
+
if(data) {
|
59
|
+
if(data.MyPass.toString === Pass) {
|
60
|
+
return true
|
61
|
+
}else {
|
62
|
+
return false
|
63
|
+
}
|
64
|
+
}else return;
|
65
|
+
})
|
66
|
+
//ContNot false
|
67
|
+
}else if(ConsoleNot === false) {
|
68
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
69
|
+
if(err) {
|
70
|
+
return console.log("Assis Error : Not Found Error")
|
71
|
+
}
|
72
|
+
if(data) {
|
73
|
+
if(data.MyPass.toString === Pass) {
|
74
|
+
return true
|
75
|
+
}else {
|
76
|
+
console.log("Assis Error : Password Is Invaild")
|
77
|
+
return false
|
78
|
+
}
|
79
|
+
}else return console.log("Assis Error : Invaild Email")
|
80
|
+
})
|
81
|
+
}else return console.log("Assis Error : 'Email','Password','true Or false' ")
|
82
|
+
}
|
83
|
+
},
|
68
84
|
|
85
|
+
//User
|
86
|
+
Users : class {
|
87
|
+
constructor() {
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
/**
|
91
|
+
*
|
92
|
+
* @param {Email} Email
|
93
|
+
* @param {Pass} Pass
|
94
|
+
*/
|
95
|
+
Data(Email , Pass) {
|
96
|
+
Accounts.findOne({MyEmail: Email} , (err , data) => {
|
97
|
+
if(err) {
|
98
|
+
return;
|
69
99
|
}
|
100
|
+
if(data) {
|
101
|
+
return data.MyName.toString()
|
102
|
+
}else return console.log("Assis Error : Email is Invaild")
|
70
103
|
})
|
71
104
|
}
|
72
105
|
}
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
73
111
|
}
|