@cedarjs/auth-dbauth-setup 2.0.1-rc.2 → 2.0.2-next.24
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/dist/setupData.js +3 -3
- package/dist/webAuthn.setupData.js +2 -2
- package/package.json +5 -5
package/dist/setupData.js
CHANGED
|
@@ -35,6 +35,6 @@ model User {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
// any notes to print out when the job is done
|
|
38
|
-
const notes = exports.notes = [`${_cliHelpers.colors.warning('Done! But you have a little more work to do:')}\n`, 'You will need to add a couple of fields to your User table in order', 'to store a hashed password and salt:', '', ' model User {', ' id Int @id @default(autoincrement())', ' email String @unique', ' hashedPassword String // <─┐', ' salt String // <─┼─ add these lines', ' resetToken String? // <─┤', ' resetTokenExpiresAt DateTime? // <─┘', ' }', '', 'If you already have existing user records you will need to provide', 'a default value for `hashedPassword` and `salt` or Prisma complains, so', 'change those to: ', '', ' hashedPassword String @default("")', ' salt String @default("")', '', 'If you expose any of your user data via GraphQL be sure to exclude', '`hashedPassword` and `salt` (or whatever you named them) from the', 'SDL file that defines the fields for your user.', '', "You'll need to let Redwood know what fields you're using for your", "users' `id` and `username` fields. In this case we're using `id` and", '`email`, so update those in the `authFields` config in', `\`${_shared.functionsPath}/auth.js\`. This is also the place to tell Redwood if`, 'you used a different name for the `hashedPassword`, `salt`,', '`resetToken` or `resetTokenExpiresAt`, fields:`', '', ' authFields: {', " id: 'id',", " username: 'email',", " hashedPassword: 'hashedPassword',", " salt: 'salt',", " resetToken: 'resetToken',", " resetTokenExpiresAt: 'resetTokenExpiresAt',", ' },', '', "To get the actual user that's logged in, take a look at `getCurrentUser()`", `in \`${_shared.libPath}/auth.js\`. We default it to something simple, but you may`, 'use different names for your model or unique ID fields, in which case you', 'need to update those calls (instructions are in the comment above the code).', '', 'Finally, we created a SESSION_SECRET environment variable for you in', `${_path.default.join((0, _cliHelpers.getPaths)().base, '.env')}. This value should NOT be checked`, 'into version control and should be unique for each environment you', 'deploy to. If you ever need to log everyone out of your app at once', 'change this secret to a new value and deploy. To create a new secret, run:', '', ' yarn
|
|
39
|
-
const notesCreatedUserModel = exports.notesCreatedUserModel = [`${_cliHelpers.colors.warning('Done! But you have a little more work to do:')}\n`, 'If you expose any of your user data via GraphQL be sure to exclude', '`hashedPassword` and `salt` (or whatever you named them) from the', 'SDL file that defines the fields for your user.', '', "To get the actual user that's logged in, take a look at `getCurrentUser()`", `in \`${_shared.libPath}/auth.js\`. We default it to something simple, but you may`, 'use different names for your model or unique ID fields, in which case you', 'need to update those calls (instructions are in the comment above the code).', '', 'Finally, we created a SESSION_SECRET environment variable for you in', `${_path.default.join((0, _cliHelpers.getPaths)().base, '.env')}. This value should NOT be checked`, 'into version control and should be unique for each environment you', 'deploy to. If you ever need to log everyone out of your app at once', 'change this secret to a new value and deploy. To create a new secret, run:', '', ' yarn
|
|
40
|
-
const noteGenerate = exports.noteGenerate = ['', "Need simple Login, Signup and Forgot Password pages? We've got a generator", 'for those as well:', '', ' yarn
|
|
38
|
+
const notes = exports.notes = [`${_cliHelpers.colors.warning('Done! But you have a little more work to do:')}\n`, 'You will need to add a couple of fields to your User table in order', 'to store a hashed password and salt:', '', ' model User {', ' id Int @id @default(autoincrement())', ' email String @unique', ' hashedPassword String // <─┐', ' salt String // <─┼─ add these lines', ' resetToken String? // <─┤', ' resetTokenExpiresAt DateTime? // <─┘', ' }', '', 'If you already have existing user records you will need to provide', 'a default value for `hashedPassword` and `salt` or Prisma complains, so', 'change those to: ', '', ' hashedPassword String @default("")', ' salt String @default("")', '', 'If you expose any of your user data via GraphQL be sure to exclude', '`hashedPassword` and `salt` (or whatever you named them) from the', 'SDL file that defines the fields for your user.', '', "You'll need to let Redwood know what fields you're using for your", "users' `id` and `username` fields. In this case we're using `id` and", '`email`, so update those in the `authFields` config in', `\`${_shared.functionsPath}/auth.js\`. This is also the place to tell Redwood if`, 'you used a different name for the `hashedPassword`, `salt`,', '`resetToken` or `resetTokenExpiresAt`, fields:`', '', ' authFields: {', " id: 'id',", " username: 'email',", " hashedPassword: 'hashedPassword',", " salt: 'salt',", " resetToken: 'resetToken',", " resetTokenExpiresAt: 'resetTokenExpiresAt',", ' },', '', "To get the actual user that's logged in, take a look at `getCurrentUser()`", `in \`${_shared.libPath}/auth.js\`. We default it to something simple, but you may`, 'use different names for your model or unique ID fields, in which case you', 'need to update those calls (instructions are in the comment above the code).', '', 'Finally, we created a SESSION_SECRET environment variable for you in', `${_path.default.join((0, _cliHelpers.getPaths)().base, '.env')}. This value should NOT be checked`, 'into version control and should be unique for each environment you', 'deploy to. If you ever need to log everyone out of your app at once', 'change this secret to a new value and deploy. To create a new secret, run:', '', ' yarn cedar generate secret', ''];
|
|
39
|
+
const notesCreatedUserModel = exports.notesCreatedUserModel = [`${_cliHelpers.colors.warning('Done! But you have a little more work to do:')}\n`, 'If you expose any of your user data via GraphQL be sure to exclude', '`hashedPassword` and `salt` (or whatever you named them) from the', 'SDL file that defines the fields for your user.', '', "To get the actual user that's logged in, take a look at `getCurrentUser()`", `in \`${_shared.libPath}/auth.js\`. We default it to something simple, but you may`, 'use different names for your model or unique ID fields, in which case you', 'need to update those calls (instructions are in the comment above the code).', '', 'Finally, we created a SESSION_SECRET environment variable for you in', `${_path.default.join((0, _cliHelpers.getPaths)().base, '.env')}. This value should NOT be checked`, 'into version control and should be unique for each environment you', 'deploy to. If you ever need to log everyone out of your app at once', 'change this secret to a new value and deploy. To create a new secret, run:', '', ' yarn cedar generate secret', '', "A new User model was added to your schema. Don't forget to migrate your db", 'before you try using dbAuth:', '', ' yarn cedar prisma migrate dev', ''];
|
|
40
|
+
const noteGenerate = exports.noteGenerate = ['', "Need simple Login, Signup and Forgot Password pages? We've got a generator", 'for those as well:', '', ' yarn cedar generate dbAuth'];
|
|
@@ -58,5 +58,5 @@ model UserCredential {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
// any notes to print out when the job is done
|
|
61
|
-
const notes = exports.notes = [`${_cliHelpers.colors.warning('Done! But you have a little more work to do:')}\n`, 'You will need to add a couple of fields to your User table in order', 'to store a hashed password, salt, reset token, and to connect it to', 'a new UserCredential model to keep track of any devices used with', 'WebAuthn authentication:', '', ' model User {', ' id Int @id @default(autoincrement())', ' email String @unique', ' hashedPassword String', ' salt String', ' resetToken String?', ' resetTokenExpiresAt DateTime?', ' webAuthnChallenge String? @unique', ' credentials UserCredential[]', ' }', '', ' model UserCredential {', ' id String @id', ' userId Int', ' user User @relation(fields: [userId], references: [id])', ' publicKey Bytes', ' transports String?', ' counter BigInt', ' }', '', 'If you already have existing user records you will need to provide', 'a default value for `hashedPassword` and `salt` or Prisma complains, so', 'change those to: ', '', ' hashedPassword String @default("")', ' salt String @default("")', '', 'If you expose any of your user data via GraphQL be sure to exclude', '`hashedPassword` and `salt` (or whatever you named them) from the', 'SDL file that defines the fields for your user.', '', "You'll need to let Redwood know what fields you're using for your", "users' `id` and `username` fields. In this case we're using `id` and", '`email`, so update those in the `authFields` config in', `\`${_shared.functionsPath}/auth.js\`. This is also the place to tell Redwood if`, 'you used a different name for the `hashedPassword`, `salt`,', '`resetToken` or `resetTokenExpiresAt`, fields:`', '', ' authFields: {', " id: 'id',", " username: 'email',", " hashedPassword: 'hashedPassword',", " salt: 'salt',", " resetToken: 'resetToken',", " resetTokenExpiresAt: 'resetTokenExpiresAt',", " challenge: 'webAuthnChallenge'", ' },', '', "To get the actual user that's logged in, take a look at `getCurrentUser()`", `in \`${_shared.libPath}/auth.js\`. We default it to something simple, but you may`, 'use different names for your model or unique ID fields, in which case you', 'need to update those calls (instructions are in the comment above the code).', '', 'Finally, we created a SESSION_SECRET environment variable for you in', `${_path.default.join((0, _cliHelpers.getPaths)().base, '.env')}. This value should NOT be checked`, 'into version control and should be unique for each environment you', 'deploy to. If you ever need to log everyone out of your app at once', 'change this secret to a new value and deploy. To create a new secret, run:', '', ' yarn
|
|
62
|
-
const noteGenerate = exports.noteGenerate = ['', 'Need simple Login, Signup, Forgot Password pages and WebAuthn prompts?', "We've got a generator for those as well:", '', ' yarn
|
|
61
|
+
const notes = exports.notes = [`${_cliHelpers.colors.warning('Done! But you have a little more work to do:')}\n`, 'You will need to add a couple of fields to your User table in order', 'to store a hashed password, salt, reset token, and to connect it to', 'a new UserCredential model to keep track of any devices used with', 'WebAuthn authentication:', '', ' model User {', ' id Int @id @default(autoincrement())', ' email String @unique', ' hashedPassword String', ' salt String', ' resetToken String?', ' resetTokenExpiresAt DateTime?', ' webAuthnChallenge String? @unique', ' credentials UserCredential[]', ' }', '', ' model UserCredential {', ' id String @id', ' userId Int', ' user User @relation(fields: [userId], references: [id])', ' publicKey Bytes', ' transports String?', ' counter BigInt', ' }', '', 'If you already have existing user records you will need to provide', 'a default value for `hashedPassword` and `salt` or Prisma complains, so', 'change those to: ', '', ' hashedPassword String @default("")', ' salt String @default("")', '', 'If you expose any of your user data via GraphQL be sure to exclude', '`hashedPassword` and `salt` (or whatever you named them) from the', 'SDL file that defines the fields for your user.', '', "You'll need to let Redwood know what fields you're using for your", "users' `id` and `username` fields. In this case we're using `id` and", '`email`, so update those in the `authFields` config in', `\`${_shared.functionsPath}/auth.js\`. This is also the place to tell Redwood if`, 'you used a different name for the `hashedPassword`, `salt`,', '`resetToken` or `resetTokenExpiresAt`, fields:`', '', ' authFields: {', " id: 'id',", " username: 'email',", " hashedPassword: 'hashedPassword',", " salt: 'salt',", " resetToken: 'resetToken',", " resetTokenExpiresAt: 'resetTokenExpiresAt',", " challenge: 'webAuthnChallenge'", ' },', '', "To get the actual user that's logged in, take a look at `getCurrentUser()`", `in \`${_shared.libPath}/auth.js\`. We default it to something simple, but you may`, 'use different names for your model or unique ID fields, in which case you', 'need to update those calls (instructions are in the comment above the code).', '', 'Finally, we created a SESSION_SECRET environment variable for you in', `${_path.default.join((0, _cliHelpers.getPaths)().base, '.env')}. This value should NOT be checked`, 'into version control and should be unique for each environment you', 'deploy to. If you ever need to log everyone out of your app at once', 'change this secret to a new value and deploy. To create a new secret, run:', '', ' yarn cedar generate secret', ''];
|
|
62
|
+
const noteGenerate = exports.noteGenerate = ['', 'Need simple Login, Signup, Forgot Password pages and WebAuthn prompts?', "We've got a generator for those as well:", '', ' yarn cedar generate dbAuth'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/auth-dbauth-setup",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2-next.24+7d862a743",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime-corejs3": "7.27.6",
|
|
28
|
-
"@cedarjs/cli-helpers": "2.0.
|
|
28
|
+
"@cedarjs/cli-helpers": "2.0.2-next.24+7d862a743",
|
|
29
29
|
"@prisma/internals": "6.19.0",
|
|
30
30
|
"@simplewebauthn/browser": "9.0.1",
|
|
31
31
|
"core-js": "3.42.0",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"@babel/cli": "7.27.2",
|
|
37
37
|
"@babel/core": "^7.26.10",
|
|
38
38
|
"@simplewebauthn/types": "9.0.1",
|
|
39
|
-
"@types/yargs": "17.0.
|
|
39
|
+
"@types/yargs": "17.0.35",
|
|
40
40
|
"ts-dedent": "2.2.0",
|
|
41
|
-
"typescript": "5.9.
|
|
41
|
+
"typescript": "5.9.3",
|
|
42
42
|
"vitest": "3.2.4"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "7d862a7432fd0821b6da7194f2fd88f3d4adb1a0"
|
|
48
48
|
}
|