jcc-express-mvc 1.3.7 → 1.3.8
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.
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const inflection = require("inflection");
|
|
4
4
|
const createMigration = (table) => {
|
|
5
5
|
return `
|
|
6
|
-
|
|
6
|
+
const {Schema} require("jcc-eloquent");
|
|
7
7
|
class Migration {
|
|
8
8
|
up() {
|
|
9
9
|
return Schema.create("${inflection.pluralize(table)}", (table) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../framework/lib/Passport/config.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,UAAU,CAAC;AAWpC,qBAAa,YAAY;IACvB;;;;OAIG;IACI,aAAa,CAAC,QAAQ,EAAE,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../framework/lib/Passport/config.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,UAAU,CAAC;AAWpC,qBAAa,YAAY;IACvB;;;;OAIG;IACI,aAAa,CAAC,QAAQ,EAAE,OAAO,YAAY;CA2DnD"}
|
package/lib/Passport/config.js
CHANGED
|
@@ -26,6 +26,7 @@ class PassportAuth {
|
|
|
26
26
|
return done(null, false, { message: "Invalid credentials" });
|
|
27
27
|
}
|
|
28
28
|
// Finding user by email in the database
|
|
29
|
+
User.hidden = User.hidden.filter((value) => value !== "password", 0);
|
|
29
30
|
const user = await User.where("email", email).first();
|
|
30
31
|
// If user does not exist, return invalid credentials
|
|
31
32
|
if (!user) {
|
|
@@ -51,6 +52,7 @@ class PassportAuth {
|
|
|
51
52
|
passport.deserializeUser(async (id, done) => {
|
|
52
53
|
try {
|
|
53
54
|
// Finding user by id in the database
|
|
55
|
+
User.hidden = ["password", ...User.hidden];
|
|
54
56
|
const user = await User.where("id", id).first();
|
|
55
57
|
// Returning user
|
|
56
58
|
done(null, user);
|