- ) => any
- flushShared: (key?: string) => void
- viewData: (key: string, value: any) => void
- getViewData: (key: string) => any
- setRootView: (newRootView: string) => void
- getRootView: () => string
- location: (path: string) => void
-}
-
-interface GoogleUser {
- id: string
- email: string
- verified_email: boolean
- name: string
- given_name: string
- family_name: string
- picture: string
- locale: string
- accessToken: string
- idToken: string
-}
-
-interface LoggedInUser {
- id: string
- fullName: string
- email: string
- initials?: string
- googleAvatarUrl?: string
- value: LoggedInUser
-}
-declare const sails: Sails
-
-declare const User
diff --git a/templates/mellow-react/views/emails/email-reset-password.ejs b/templates/mellow-react/views/emails/email-reset-password.ejs
new file mode 100644
index 00000000..e2628795
--- /dev/null
+++ b/templates/mellow-react/views/emails/email-reset-password.ejs
@@ -0,0 +1,33 @@
+Dear <%= fullName %>,
+
+ Someone requested a password reset for your account. If this was not you,
+ please disregard this email. Otherwise, simply click the button below:
+
+
+
+ If you have any trouble, try pasting this link in your browser:
+ <%=
+ url.resolve(sails.config.custom.baseUrl,'/reset-password')+'?token='+encodeURIComponent(token)
+ %>
+
+Sincerely,
+The Boring JavaScript Stack Team
diff --git a/templates/mellow-react/views/emails/email-verify-account.ejs b/templates/mellow-react/views/emails/email-verify-account.ejs
new file mode 100644
index 00000000..e989d578
--- /dev/null
+++ b/templates/mellow-react/views/emails/email-verify-account.ejs
@@ -0,0 +1,9 @@
+<% /* Note: This is injected into `views/layouts/layout-email.ejs` */ %>
+Welcome, <%= fullName %>!
+You're almost ready to get started. Just click the button below to verify the email address for your account:
+
+If you have any trouble, try pasting this link in your browser: <%= url.resolve(sails.config.custom.baseUrl,'/verify-email')+'?token='+encodeURIComponent(token) %>
+Sincerely,
+The Boring JavaScript Stack Team
diff --git a/templates/mellow-react/views/emails/email-verify-new-email.ejs b/templates/mellow-react/views/emails/email-verify-new-email.ejs
new file mode 100644
index 00000000..173aa1ea
--- /dev/null
+++ b/templates/mellow-react/views/emails/email-verify-new-email.ejs
@@ -0,0 +1,57 @@
+
+ Confirm Your New Email, <%= fullName %>!
+
+
+ We've received a request to change your email address. To complete this
+ process, please click the button below to verify your new email address:
+
+
+
+ If you have any trouble, try pasting this link in your browser:
+ <%=
+ url.resolve(sails.config.custom.baseUrl,'/verify-email')+'?token='+encodeURIComponent(token)
+ %>
+
+
+ If you didn't request this change, please ignore this email or contact our
+ support team if you have any concerns.
+
+Sincerely,
+The Mellow Team
diff --git a/templates/mellow-react/views/layouts/layout-email.ejs b/templates/mellow-react/views/layouts/layout-email.ejs
new file mode 100644
index 00000000..9ff8bd40
--- /dev/null
+++ b/templates/mellow-react/views/layouts/layout-email.ejs
@@ -0,0 +1,12 @@
+<% /* Default layout for email templates */ %>
+
+
+
+
+ <%- body %>
+
+
+
© 2023 The Boring JavaScript Stack All trademarks, service marks, and company names are the property of their respective owners.
+
+
+
diff --git a/templates/mellow-vue/api/controllers/auth/callback.js b/templates/mellow-vue/api/controllers/auth/callback.js
index 928dc808..167022f9 100644
--- a/templates/mellow-vue/api/controllers/auth/callback.js
+++ b/templates/mellow-vue/api/controllers/auth/callback.js
@@ -21,7 +21,6 @@ module.exports = {
},
fn: async function ({ code, provider }, exits) {
const req = this.req
- /** @type GoogleUser */
const googleUser = await sails.wish.provider(provider).user(code)
User.findOrCreate(
diff --git a/templates/mellow-vue/api/controllers/user/update-profile.js b/templates/mellow-vue/api/controllers/user/update-profile.js
index 725d96ff..67aac57e 100644
--- a/templates/mellow-vue/api/controllers/user/update-profile.js
+++ b/templates/mellow-vue/api/controllers/user/update-profile.js
@@ -25,7 +25,7 @@ module.exports = {
allowNull: true,
description: 'The new password of the user.'
},
- passwordConfirmation: {
+ confirmPassword: {
type: 'string',
description: 'The confirmation of the new password.',
allowNull: true
@@ -52,7 +52,7 @@ module.exports = {
email,
currentPassword,
password,
- passwordConfirmation
+ confirmPassword
}) {
const userId = this.req.session.userId
const user = await User.findOne({ id: userId }).select([
@@ -89,7 +89,7 @@ module.exports = {
}
if (password) {
- if (password !== passwordConfirmation) {
+ if (password !== confirmPassword) {
throw {
invalid: {
problems: [{ password: 'Password confirmation does not match.' }]
diff --git a/templates/mellow-vue/api/controllers/user/view-profile.js b/templates/mellow-vue/api/controllers/user/view-profile.js
index 62d61051..8d1727ea 100644
--- a/templates/mellow-vue/api/controllers/user/view-profile.js
+++ b/templates/mellow-vue/api/controllers/user/view-profile.js
@@ -10,6 +10,6 @@ module.exports = {
},
fn: async function () {
- return { page: 'user/profile' }
+ return { page: 'dashboard/profile' }
}
}
diff --git a/templates/mellow-vue/api/models/User.js b/templates/mellow-vue/api/models/User.js
index 67f04ce3..15b68476 100644
--- a/templates/mellow-vue/api/models/User.js
+++ b/templates/mellow-vue/api/models/User.js
@@ -120,7 +120,6 @@ module.exports = {
}, {})
},
beforeCreate: async function (valuesToSet, proceed) {
- valuesToSet.id = sails.helpers.strings.uuid()
valuesToSet.initials = sails.helpers.getUserInitials(valuesToSet.fullName)
if (valuesToSet.password) {
valuesToSet.password = await sails.helpers.passwords.hashPassword(
diff --git a/templates/mellow-vue/api/responses/badRequest.js b/templates/mellow-vue/api/responses/badRequest.js
index 142fcd6b..0c9aa420 100644
--- a/templates/mellow-vue/api/responses/badRequest.js
+++ b/templates/mellow-vue/api/responses/badRequest.js
@@ -68,7 +68,7 @@ module.exports = function badRequest(optionalData) {
}
})
req.session.errors = errors
- return res.redirect(303, 'back')
+ return res.redirect(303, req.get('Referrer') || '/')
}
}
diff --git a/templates/mellow-vue/assets/js/components/InputBase.vue b/templates/mellow-vue/assets/js/components/InputBase.vue
index f91ab683..518eda52 100644
--- a/templates/mellow-vue/assets/js/components/InputBase.vue
+++ b/templates/mellow-vue/assets/js/components/InputBase.vue
@@ -41,3 +41,8 @@ function updateValue(event) {
+
diff --git a/templates/mellow-vue/assets/js/components/InputEmail.vue b/templates/mellow-vue/assets/js/components/InputEmail.vue
index c8d24279..965d078d 100644
--- a/templates/mellow-vue/assets/js/components/InputEmail.vue
+++ b/templates/mellow-vue/assets/js/components/InputEmail.vue
@@ -3,7 +3,7 @@ import InputBase from '@/components/InputBase'
-
+
import { Link, Head, useForm } from '@inertiajs/vue3'
import { computed } from 'vue'
-
+import InputEmail from '@/components/InputEmail'
+import InputButton from '@/components/InputButton'
const form = useForm({
email: null
})
@@ -60,57 +61,16 @@ const disableForgetPasswordButton = computed(() => {
@submit.prevent="form.post('/forgot-password')"
class="mb-4 flex flex-col space-y-6"
>
- Email
-
-
-
-
-
-
-
-
+
+ {{ form.errors.email }}
+
+
+ Forgot password
-
-
-
-
- Reset password
-
@@ -132,8 +92,3 @@ const disableForgetPasswordButton = computed(() => {
-
diff --git a/templates/mellow-vue/assets/js/pages/auth/login.vue b/templates/mellow-vue/assets/js/pages/auth/login.vue
index 393b851e..f22e8da9 100644
--- a/templates/mellow-vue/assets/js/pages/auth/login.vue
+++ b/templates/mellow-vue/assets/js/pages/auth/login.vue
@@ -78,7 +78,8 @@ const disableLoginButton = computed(() => {
+ >Login
@@ -90,8 +91,3 @@ const disableLoginButton = computed(() => {
-
diff --git a/templates/mellow-vue/assets/js/pages/auth/reset-password.vue b/templates/mellow-vue/assets/js/pages/auth/reset-password.vue
index f58450e5..2690064c 100644
--- a/templates/mellow-vue/assets/js/pages/auth/reset-password.vue
+++ b/templates/mellow-vue/assets/js/pages/auth/reset-password.vue
@@ -1,6 +1,8 @@
-
+
@@ -79,186 +81,25 @@ const disableResetPasswordButton = computed(() => {
@submit.prevent="form.post('/reset-password')"
class="mb-4 flex flex-col space-y-6"
>
- New password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Confirm password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ {{ form.errors.password }}
+
+
+
+
+ {{ form.errors.confirmPassword }}
+
+
{
At least 1 special characters
-
-
-
-
-
-
- Reset password
-
+ >Reset password
+
diff --git a/templates/mellow-vue/assets/js/pages/auth/signup.vue b/templates/mellow-vue/assets/js/pages/auth/signup.vue
index d1562505..cc3b9f9b 100644
--- a/templates/mellow-vue/assets/js/pages/auth/signup.vue
+++ b/templates/mellow-vue/assets/js/pages/auth/signup.vue
@@ -153,7 +153,8 @@ const disableSignupButton = computed(() => {
+ >Sign up
diff --git a/templates/mellow-vue/assets/js/pages/user/profile.vue b/templates/mellow-vue/assets/js/pages/dashboard/profile.vue
similarity index 94%
rename from templates/mellow-vue/assets/js/pages/user/profile.vue
rename to templates/mellow-vue/assets/js/pages/dashboard/profile.vue
index 3b6cae72..df0268a4 100644
--- a/templates/mellow-vue/assets/js/pages/user/profile.vue
+++ b/templates/mellow-vue/assets/js/pages/dashboard/profile.vue
@@ -1,5 +1,4 @@
-
+
Simplify Authentication, Focus on Shipping 🚀
diff --git a/templates/mellow-vue/config/blueprints.js b/templates/mellow-vue/config/blueprints.js
index c9c82b58..9966546a 100644
--- a/templates/mellow-vue/config/blueprints.js
+++ b/templates/mellow-vue/config/blueprints.js
@@ -28,5 +28,5 @@ module.exports.blueprints = {
* (These are enabled by default in development only.) *
* *
***************************************************************************/
- shortcuts: false,
+ shortcuts: false
}
diff --git a/templates/mellow-vue/config/custom.js b/templates/mellow-vue/config/custom.js
index 7de23a39..0a668dbf 100644
--- a/templates/mellow-vue/config/custom.js
+++ b/templates/mellow-vue/config/custom.js
@@ -40,11 +40,8 @@ module.exports.custom = {
rememberMeCookieMaxAge: 30 * 24 * 60 * 60 * 1000, // 30 days
// Email address for receiving support messages & other correspondences.
- internalEmail: 'support+development@example.com',
+ internalEmail: 'support+development@example.com'
- // Whether to require proof of email address ownership any time a new user
- // signs up, or when an existing user attempts to change their email address.
- verifyEmail: false
/***************************************************************************
* *
* Any other custom config this Sails app should use during development. *
diff --git a/templates/mellow-vue/config/models.js b/templates/mellow-vue/config/models.js
index 89d228d7..96f6be96 100644
--- a/templates/mellow-vue/config/models.js
+++ b/templates/mellow-vue/config/models.js
@@ -67,7 +67,7 @@ module.exports.models = {
attributes: {
createdAt: { type: 'number', autoCreatedAt: true },
updatedAt: { type: 'number', autoUpdatedAt: true },
- id: { type: 'string' }
+ id: { type: 'number', autoIncrement: true }
//--------------------------------------------------------------------------
// /\ Using MongoDB?
// || Replace `id` above with this instead:
diff --git a/templates/mellow-vue/package-lock.json b/templates/mellow-vue/package-lock.json
index 928cab5c..ce625b18 100644
--- a/templates/mellow-vue/package-lock.json
+++ b/templates/mellow-vue/package-lock.json
@@ -28,8 +28,8 @@
"@types/node": "^22.5.5",
"create-sails-generator": "^0.0.3",
"playwright": "^1.47.1",
- "prettier": "^3.3.3",
- "prettier-plugin-tailwindcss": "^0.6.6",
+ "prettier": "^2.8.8",
+ "prettier-plugin-tailwindcss": "^0.4.1",
"sails-hook-dev": "^1.3.0",
"sails-hook-shipwright": "^0.3.0",
"sails.io.js": "^1.2.1",
@@ -4209,46 +4209,47 @@
"dev": true
},
"node_modules/prettier": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
- "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
+ "license": "MIT",
"bin": {
- "prettier": "bin/prettier.cjs"
+ "prettier": "bin-prettier.js"
},
"engines": {
- "node": ">=14"
+ "node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/prettier-plugin-tailwindcss": {
- "version": "0.6.6",
- "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.6.tgz",
- "integrity": "sha512-OPva5S7WAsPLEsOuOWXATi13QrCKACCiIonFgIR6V4lYv4QLp++UXVhZSzRbZxXGimkQtQT86CC6fQqTOybGng==",
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.4.1.tgz",
+ "integrity": "sha512-hwn2EiJmv8M+AW4YDkbjJ6HlZCTzLyz1QlySn9sMuKV/Px0fjwldlB7tol8GzdgqtkdPtzT3iJ4UzdnYXP25Ag==",
"dev": true,
+ "license": "MIT",
"engines": {
- "node": ">=14.21.3"
+ "node": ">=12.17.0"
},
"peerDependencies": {
"@ianvs/prettier-plugin-sort-imports": "*",
"@prettier/plugin-pug": "*",
"@shopify/prettier-plugin-liquid": "*",
+ "@shufo/prettier-plugin-blade": "*",
"@trivago/prettier-plugin-sort-imports": "*",
- "@zackad/prettier-plugin-twig-melody": "*",
- "prettier": "^3.0",
+ "prettier": "^2.2 || ^3.0",
"prettier-plugin-astro": "*",
"prettier-plugin-css-order": "*",
"prettier-plugin-import-sort": "*",
"prettier-plugin-jsdoc": "*",
"prettier-plugin-marko": "*",
- "prettier-plugin-multiline-arrays": "*",
"prettier-plugin-organize-attributes": "*",
"prettier-plugin-organize-imports": "*",
- "prettier-plugin-sort-imports": "*",
"prettier-plugin-style-order": "*",
- "prettier-plugin-svelte": "*"
+ "prettier-plugin-svelte": "*",
+ "prettier-plugin-twig-melody": "*"
},
"peerDependenciesMeta": {
"@ianvs/prettier-plugin-sort-imports": {
@@ -4260,10 +4261,10 @@
"@shopify/prettier-plugin-liquid": {
"optional": true
},
- "@trivago/prettier-plugin-sort-imports": {
+ "@shufo/prettier-plugin-blade": {
"optional": true
},
- "@zackad/prettier-plugin-twig-melody": {
+ "@trivago/prettier-plugin-sort-imports": {
"optional": true
},
"prettier-plugin-astro": {
@@ -4281,23 +4282,20 @@
"prettier-plugin-marko": {
"optional": true
},
- "prettier-plugin-multiline-arrays": {
- "optional": true
- },
"prettier-plugin-organize-attributes": {
"optional": true
},
"prettier-plugin-organize-imports": {
"optional": true
},
- "prettier-plugin-sort-imports": {
- "optional": true
- },
"prettier-plugin-style-order": {
"optional": true
},
"prettier-plugin-svelte": {
"optional": true
+ },
+ "prettier-plugin-twig-melody": {
+ "optional": true
}
}
},
diff --git a/templates/mellow-vue/package.json b/templates/mellow-vue/package.json
index 17be59bc..0c2d9693 100644
--- a/templates/mellow-vue/package.json
+++ b/templates/mellow-vue/package.json
@@ -25,8 +25,8 @@
"@types/node": "^22.5.5",
"create-sails-generator": "^0.0.3",
"playwright": "^1.47.1",
- "prettier": "^3.3.3",
- "prettier-plugin-tailwindcss": "^0.6.6",
+ "prettier": "^2.8.8",
+ "prettier-plugin-tailwindcss": "^0.4.1",
"sails-hook-dev": "^1.3.0",
"sails-hook-shipwright": "^0.3.0",
"sails.io.js": "^1.2.1",