Browse Source

Merge remote-tracking branch 'origin/polishing' into owen

Owen Diffey 3 năm trước cách đây
mục cha
commit
67cc2af45c

+ 1 - 0
backend/logic/actions/users.js

@@ -536,6 +536,7 @@ export default {
 				(hash, _id, next) => {
 					next(null, {
 						_id,
+						name: "",
 						username,
 						email: {
 							address: email,

+ 3 - 3
backend/logic/db/index.js

@@ -141,9 +141,9 @@ class _DBModule extends CoreClass {
 						return regex.emailSimple.test(email) && regex.ascii.test(email);
 					}, "Invalid email.");
 
-					this.schemas.user
-						.path("name")
-						.validate(name => isLength(name, 1, 64) && regex.name.test(name), "Invalid name.");
+					// this.schemas.user
+					// 	.path("name")
+					// 	.validate(name => isLength(name, 1, 64) && regex.name.test(name), "Invalid name.");
 
 					// Station
 					this.schemas.station

+ 3 - 3
frontend/package-lock.json

@@ -8233,9 +8233,9 @@
       "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw=="
     },
     "tar": {
-      "version": "6.1.5",
-      "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.5.tgz",
-      "integrity": "sha512-FiK6MQyyaqd5vHuUjbg/NpO8BuEGeSXcmlH7Pt/JkugWS8s0w8nKybWjHDJiwzCAIKZ66uof4ghm4tBADjcqRA==",
+      "version": "6.1.11",
+      "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
+      "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
       "dev": true,
       "requires": {
         "chownr": "^2.0.0",

+ 12 - 3
frontend/src/api/auth.js

@@ -25,14 +25,18 @@ export default {
 									new Date().getTime() +
 										2 * 365 * 24 * 60 * 60 * 1000
 								);
+
 								const secure = cookie.secure
 									? "secure=true; "
 									: "";
+
+								let domain = "";
+								if (cookie.domain !== "localhost")
+									domain = ` domain=${cookie.domain};`;
+
 								document.cookie = `SID=${
 									res.SID
-								}; expires=${date.toGMTString()}; domain=${
-									cookie.domain
-								}; ${secure}path=/`;
+								}; expires=${date.toGMTString()}; ${domain}${secure}path=/`;
 
 								return resolve({
 									status: "success",
@@ -40,6 +44,7 @@ export default {
 								});
 							});
 						}
+
 						return reject(new Error("You must login"));
 					}
 
@@ -59,13 +64,17 @@ export default {
 						date.setTime(
 							new Date().getTime() + 2 * 365 * 24 * 60 * 60 * 1000
 						);
+
 						const secure = cookie.secure ? "secure=true; " : "";
+
 						let domain = "";
 						if (cookie.domain !== "localhost")
 							domain = ` domain=${cookie.domain};`;
+
 						document.cookie = `${cookie.SIDname}=${
 							res.data.SID
 						}; expires=${date.toGMTString()}; ${domain}${secure}path=/`;
+
 						return resolve({ status: "success" });
 					});
 				}

+ 17 - 5
frontend/src/components/layout/MainHeader.vue

@@ -115,6 +115,17 @@ export default {
 		background-color: var(--dark-grey-3) !important;
 	}
 
+	@media screen and (max-width: 768px) {
+		.nav-menu {
+			background-color: var(--dark-grey-3) !important;
+		}
+
+		.nav-item,
+		.grouped {
+			border-color: transparent;
+		}
+	}
+
 	.nav-item {
 		color: var(--light-grey-2) !important;
 	}
@@ -152,11 +163,7 @@ export default {
 
 	.nav-toggle {
 		height: 64px;
-
-		&:hover,
-		&:active {
-			filter: brightness(95%);
-		}
+		background-color: transparent;
 
 		span {
 			background-color: var(--white);
@@ -189,5 +196,10 @@ export default {
 	margin: 0;
 	display: flex;
 	text-decoration: none;
+	border-top: 1px solid rgba(219, 219, 219, 0.5);
+
+	.nav-item {
+		border-top: 0;
+	}
 }
 </style>

+ 1 - 1
frontend/src/components/modals/Register.vue

@@ -305,7 +305,7 @@ export default {
 				recaptchaToken: this.recaptcha.token
 			})
 				.then(res => {
-					if (res.status === "success") window.location.href = "/";
+					if (res.status === "success") window.location.reload();
 				})
 				.catch(err => new Toast(err.message));
 		},