notherbase-fs 3.3.12 → 3.3.14

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/models/user.js CHANGED
@@ -36,7 +36,8 @@ export default class User extends Spirit {
36
36
  user.memory = found;
37
37
  user.id = found._id;
38
38
  user.data = found.data.backups[0].data;
39
- user.email = user.data.email;
39
+ user.email = found.data.backups[0].data.email;
40
+ user.username = found.data.backups[0].data.username;
40
41
 
41
42
  return user;
42
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "3.3.12",
3
+ "version": "3.3.14",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
@@ -619,6 +619,10 @@ iframe {
619
619
  width: 250px;
620
620
  }
621
621
 
622
+ .login-cover a img {
623
+ width: 50%;
624
+ }
625
+
622
626
  .dialogue {
623
627
  width: var(--fillFromMargin);
624
628
  border-radius: var(--borderRadius);
@@ -13,25 +13,62 @@
13
13
  <% if (requireUser && !user) { %>
14
14
  <div class="login-cover">
15
15
  <a class="header-link" href="/">
16
+ <img src="/img/logo.png">
16
17
  <h1>NotherBase</h1>
17
18
  </a>
18
- <h3>Login to Your Account</h3>
19
- <input type="email" placeholder="user@email.com" id="email">
20
- <input type="password" placeholder="password" id="pass">
21
- <button id="login" onclick="coverLogin()">Login</button>
22
- <a href="/the-front/keeper">Reset Password</a>
19
+ <div class="form">
20
+ <h3>Login to Your Account</h3>
21
+ <label>
22
+ <h4>Your Email:</h4>
23
+ <input type="email" placeholder="user@email.com" id="email">
24
+ </label>
25
+ <label>
26
+ <h4>Your Password:</h4>
27
+ <input type="password" placeholder="password" id="pass">
28
+ </label>
29
+ <button id="login" onclick="coverLogin()">Login</button>
30
+ <a href="/the-front/keeper">Reset Password</a>
31
+ </div>
23
32
  <p class="info"></p>
24
33
 
25
34
  <script>
26
35
  const coverLogin = async () => {
27
- let response = await base.attemptLogin(
28
- $(".login-cover #email").val(),
29
- $(".login-cover #pass").val()
30
- );
36
+ let $email = $(".login-cover #email");
37
+ let email = $email.val();
38
+ $email.val("");
39
+ let $pass = $(".login-cover #pass");
40
+ let pass = $pass.val();
41
+ $pass.val("");
31
42
 
43
+ let $form = $(".login-cover .form");
44
+ $form.css("display", "none");
45
+ let $info = $(".login-cover .info");
46
+ $info.text("Attempting to login...");
47
+
48
+ let response = await base.attemptLogin(email, pass);
49
+
50
+ $form.css("display", "initial");
51
+ $info.text(response.message);
32
52
  if (response.status === "success") location.reload();
33
- $(".login-cover .info").text(response.message);
53
+ else {
54
+ $email.focus();
55
+ $email.val(email);
56
+ }
34
57
  };
58
+
59
+ $('.login-cover #email').keypress(function (e) {
60
+ if (e.which == 13) {
61
+ coverLogin();
62
+ e.stopPropagation();
63
+ }
64
+ });
65
+
66
+ $('.login-cover #pass').keypress(function (e) {
67
+ if (e.which == 13) {
68
+ coverLogin();
69
+ e.stopPropagation();
70
+ }
71
+ });
35
72
  </script>
36
73
  </div>
37
74
  <% } else { %>