You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Built out PnwedPasswords.com API functionality into is-password-valid helper. FINALLY removed the usage of res._headers, so no more annoying deprecation message. Simplified stored session data.
+ Setup so Sails will serve Webpack-built bundles as separate apps (so, a marketing site, and an admin site can live side-by-side).
14
-
+ Includes [react-bootstrap](https://www.npmjs.com/package/react-bootstrap) to make using Bootstrap styles / features with React easier.
15
-
+ Schema validation and enforcement for `PRODUCTION`. This repo is set up for `MySQL`. If you plan to use a different datastore, you will likely want to disable the schema validation and enforcement feature inside [`config/bootstrap.js`](config/bootstrap.js). See [schema validation and enforcement](#schema-validation-and-enforcement) for more info.
* Setup so Sails will serve Webpack-built bundles as separate apps (so, a marketing site, and an admin site can live side-by-side).
14
+
* Includes [react-bootstrap](https://www.npmjs.com/package/react-bootstrap) to make using Bootstrap styles / features with React easier.
15
+
* Schema validation and enforcement for `PRODUCTION`. This repo is set up for `MySQL`. If you plan to use a different datastore, you will likely want to disable the schema validation and enforcement feature inside [`config/bootstrap.js`](config/bootstrap.js). See [schema validation and enforcement](#schema-validation-and-enforcement) for more info.
16
+
* Can enforce password creation isn't found in [PwnedPasswords]()
16
17
17
18
## Branch Warning
18
19
The `master` branch is experimental, and the [release branch](https://github.com/neonexus/sails-react-bootstrap-webpack/tree/release) (or the [`releases section`](https://github.com/neonexus/sails-react-bootstrap-webpack/releases)) is where one should base their use of this template.
@@ -70,10 +71,10 @@ If you DO NOT like this behavior, and would prefer the variables stay the same a
| ASSETS_URL | "" (empty string) | Webpack is configured to modify static asset URLs to point to a CDN, like CloudFront. MUST end with a slash " / ", or be empty. |
72
73
| BASE_URL |https://myapi.app| The address of the Sails instance. |
73
-
|**DEV:** DB_HOST<br />**PROD:** DB_HOSTNAME | localhost | The hostname of the datastore. |
74
-
|**DEV:** DB_USER<br />**PROD:** DB_USERNAME |**DEV:** root <br /> **PROD:** produser | Username of the datastore. |
75
-
|**DEV:** DB_PASS<br />**PROD:** DB_PASSWORD |**DEV:** mypass <br /> **PROD:** prodpass | Password of the datastore. |
76
-
| DB_NAME |**DEV:** myapp <br /> **PROD:** prod | The name of the database inside the datastore. |
74
+
| **DEV:** DB_HOST<br />**PROD:** DB_HOSTNAME | localhost | The hostname of the datastore. |
75
+
| **DEV:** DB_USER<br />**PROD:** DB_USERNAME | **DEV:** root <br /> **PROD:** produser | Username of the datastore. |
76
+
| **DEV:** DB_PASS<br />**PROD:** DB_PASSWORD | **DEV:** mypass <br /> **PROD:** prodpass | Password of the datastore. |
77
+
| DB_NAME | **DEV:** myapp <br /> **PROD:** prod | The name of the database inside the datastore. |
77
78
| DB_PORT | 3306 | The port number for the datastore. |
78
79
| DB_SSL | true | If the datastore requires SSL, set this to "true". |
79
80
| SESSION_SECRET | "" (empty string) | Used to sign cookies, and SHOULD be set, especially on PRODUCTION environments. |
description: 'Get paginated list of soft-deleted users',
5
+
6
+
inputs: {
7
+
page: {
8
+
description: 'The page number to return',
9
+
type: 'number',
10
+
defaultsTo: 1,
11
+
min: 1
12
+
},
13
+
14
+
limit: {
15
+
description: 'The amount of users to return',
16
+
type: 'number',
17
+
defaultsTo: 25,
18
+
min: 1,
19
+
max: 500
20
+
}
21
+
},
22
+
23
+
exits: {
24
+
ok: {
25
+
responseType: 'ok'
26
+
},
27
+
badRequest: {
28
+
responseType: 'badRequest'
29
+
},
30
+
serverError: {
31
+
responseType: 'serverError'
32
+
}
33
+
},
34
+
35
+
fn: async(inputs,exits)=>{
36
+
constquery=sails.helpers.paginateForQuery.with({
37
+
limit: inputs.limit,
38
+
page: inputs.page,
39
+
where: {
40
+
deletedAt: {'!=': null}// get all soft-deleted users
41
+
},
42
+
sort: [{deletedAt: 'ASC'},{createdAt: 'DESC'}]
43
+
});
44
+
45
+
letout=awaitsails.helpers.paginateForJson.with({
46
+
model: sails.models.user,
47
+
objToWrap: {users: []},// this is the object that will be output to "out", and will contain additional pagination info,
48
+
query
49
+
});
50
+
51
+
// We assign the users to the object afterward, so we can run our safety checks.
52
+
// Otherwise, if we were to put the users object into "objToWrap", they would be transformed, and the "customToJSON" feature would no longer work, and hashed passwords would leak.
// We assign the users to the object afterward, so we can run our safety checks.
50
48
// Otherwise, if we were to put the users object into "objToWrap", they would be transformed, and the "customToJSON" feature would no longer work, and hashed passwords would leak.
0 commit comments