nuxt-users 1.1.2 → 1.1.4
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/.vscode/settings.json +18 -0
- package/CHANGELOG.md +174 -0
- package/README.md +12 -2
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +269 -0
- package/dist/module.d.mts +1 -51
- package/dist/module.d.ts +7 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +11 -81
- package/dist/runtime/assets/colors.css +1 -0
- package/dist/runtime/components/ForgotPasswordForm.vue +21 -23
- package/dist/runtime/components/LoginForm.vue +42 -30
- package/dist/runtime/components/LoginForm.vue.d.ts +8 -8
- package/dist/runtime/components/ResetPasswordForm.vue +40 -33
- package/dist/runtime/plugin.js +13 -3
- package/dist/runtime/server/api/login.post.js +1 -1
- package/dist/runtime/server/services/password.js +1 -2
- package/dist/shared/nuxt-users.Dtq4WcpY.d.mts +58 -0
- package/dist/shared/nuxt-users.Dtq4WcpY.d.ts +58 -0
- package/dist/shared/nuxt-users.eSQUrS6l.mjs +333 -0
- package/dist/utils.d.mts +37 -0
- package/dist/utils.d.ts +37 -0
- package/dist/utils.mjs +3 -0
- package/package.json +59 -27
- package/data/default.sqlite3 +0 -0
- package/dist/runtime/server/utils/create-migrations-table.d.ts +0 -2
- package/dist/runtime/server/utils/create-migrations-table.js +0 -35
- package/dist/runtime/server/utils/create-password-reset-tokens-table.d.ts +0 -2
- package/dist/runtime/server/utils/create-password-reset-tokens-table.js +0 -40
- package/dist/runtime/server/utils/create-personal-access-tokens-table.d.ts +0 -2
- package/dist/runtime/server/utils/create-personal-access-tokens-table.js +0 -56
- package/dist/runtime/server/utils/create-user.d.ts +0 -1
- package/dist/runtime/server/utils/create-user.js +0 -1
- package/dist/runtime/server/utils/create-users-table.d.ts +0 -2
- package/dist/runtime/server/utils/create-users-table.js +0 -44
- package/dist/runtime/server/utils/db.d.ts +0 -8
- package/dist/runtime/server/utils/db.js +0 -61
- package/dist/runtime/server/utils/migrate.d.ts +0 -4
- package/dist/runtime/server/utils/migrate.js +0 -63
- package/dist/runtime/server/utils/user.d.ts +0 -21
- package/dist/runtime/server/utils/user.js +0 -50
- package/src/cli/create-migrations-table.ts +0 -24
- package/src/cli/create-password-reset-tokens-table.ts +0 -24
- package/src/cli/create-personal-access-tokens-table.ts +0 -24
- package/src/cli/create-user.ts +0 -40
- package/src/cli/create-users-table.ts +0 -24
- package/src/cli/main.ts +0 -28
- package/src/cli/migrate.ts +0 -24
- package/src/cli/project-info.ts +0 -45
- package/src/cli/utils.ts +0 -70
package/src/cli/utils.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { ModuleOptions, DatabaseConfig } from '../types'
|
|
2
|
-
|
|
3
|
-
export const defaultOptions: ModuleOptions = {
|
|
4
|
-
connector: {
|
|
5
|
-
name: 'sqlite',
|
|
6
|
-
options: {
|
|
7
|
-
path: './data/default.sqlite3',
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
tables: {
|
|
11
|
-
users: 'users',
|
|
12
|
-
personalAccessTokens: 'personal_access_tokens',
|
|
13
|
-
passwordResetTokens: 'password_reset_tokens',
|
|
14
|
-
},
|
|
15
|
-
mailer: {
|
|
16
|
-
host: 'smtp.ethereal.email',
|
|
17
|
-
port: 587,
|
|
18
|
-
secure: false,
|
|
19
|
-
auth: {
|
|
20
|
-
user: 'user@ethereal.email',
|
|
21
|
-
pass: 'password',
|
|
22
|
-
},
|
|
23
|
-
defaults: {
|
|
24
|
-
from: '"Nuxt Users Module" <noreply@example.com>',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
passwordResetBaseUrl: 'http://localhost:3000',
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const getOptionsFromEnv = (): ModuleOptions => {
|
|
31
|
-
const connectorName = process.env.DB_CONNECTOR || 'sqlite'
|
|
32
|
-
|
|
33
|
-
let connectorOptions: DatabaseConfig
|
|
34
|
-
|
|
35
|
-
switch (connectorName) {
|
|
36
|
-
case 'sqlite':
|
|
37
|
-
connectorOptions = {
|
|
38
|
-
path: process.env.DB_PATH || './data/default.sqlite3',
|
|
39
|
-
}
|
|
40
|
-
break
|
|
41
|
-
case 'mysql':
|
|
42
|
-
connectorOptions = {
|
|
43
|
-
host: process.env.DB_HOST || 'localhost',
|
|
44
|
-
port: Number.parseInt(process.env.DB_PORT || '3306'),
|
|
45
|
-
user: process.env.DB_USER || 'root',
|
|
46
|
-
password: process.env.DB_PASSWORD || '',
|
|
47
|
-
database: process.env.DB_NAME || 'nuxt_users',
|
|
48
|
-
}
|
|
49
|
-
break
|
|
50
|
-
case 'postgresql':
|
|
51
|
-
connectorOptions = {
|
|
52
|
-
host: process.env.DB_HOST || 'localhost',
|
|
53
|
-
port: Number.parseInt(process.env.DB_PORT || '5432'),
|
|
54
|
-
user: process.env.DB_USER || 'postgres',
|
|
55
|
-
password: process.env.DB_PASSWORD || '',
|
|
56
|
-
database: process.env.DB_NAME || 'nuxt_users',
|
|
57
|
-
}
|
|
58
|
-
break
|
|
59
|
-
default:
|
|
60
|
-
throw new Error(`Unsupported database connector: ${connectorName}`)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
...defaultOptions,
|
|
65
|
-
connector: {
|
|
66
|
-
name: connectorName as 'sqlite' | 'mysql' | 'postgresql',
|
|
67
|
-
options: connectorOptions,
|
|
68
|
-
},
|
|
69
|
-
}
|
|
70
|
-
}
|