assisweb 9.3.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 +48 -23
  2. 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
- const Nothing = new Accounts({
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
- UserData : async function(Email , Type) {
35
- await Accounts.findOne({MyEmail: Email} , (err , data) => {
36
- if(err) {
37
- return;
38
- }
39
-
40
- if(data) {
41
- if(Type === "Name")return data.MyName
42
- if(Type === "Email")return data.MyEmail
43
- if(Type === "ID")return data.MyID
44
- }else return console.log("Assis Error : Email Not Found")
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
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "mongoose": "^6.2.8"
4
4
  },
5
5
  "name": "assisweb",
6
- "version": "9.3.0",
6
+ "version": "10.0.0",
7
7
  "main": "index.js",
8
8
  "devDependencies": {},
9
9
  "scripts": {