assisweb 9.5.0 → 10.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +47 -13
  2. 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
- UserData : function(Email , Type) {
26
- Accounts.findOne({MyEmail: Email} , (err , data) => {
27
- if(err) {
28
- return;
29
- }
30
-
31
- if(data) {
32
- if(Type === "Name")return data.MyName
33
- if(Type === "Email")return data.MyEmail
34
- if(Type === "ID")return data.MyID
35
- }else return console.log("Assis Error : Email Not Found")
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
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "mongoose": "^6.2.8"
4
4
  },
5
5
  "name": "assisweb",
6
- "version": "9.5.0",
6
+ "version": "10.0.0",
7
7
  "main": "index.js",
8
8
  "devDependencies": {},
9
9
  "scripts": {