@monocloud/auth-node-core 0.1.13 → 0.1.15
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/index.cjs +35 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3 -9
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +7 -7
- package/dist/utils/index.mjs +2 -3
- package/dist/utils/internal.cjs +7 -7
- package/dist/utils/internal.mjs +2 -3
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -7,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
20
16
|
}
|
|
21
17
|
return to;
|
|
22
18
|
};
|
|
@@ -24,7 +20,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
20
|
value: mod,
|
|
25
21
|
enumerable: true
|
|
26
22
|
}) : target, mod));
|
|
27
|
-
|
|
28
23
|
//#endregion
|
|
29
24
|
let _monocloud_auth_core = require("@monocloud/auth-core");
|
|
30
25
|
let jose = require("jose");
|
|
@@ -36,7 +31,6 @@ let joi = require("joi");
|
|
|
36
31
|
joi = __toESM(joi);
|
|
37
32
|
let debug = require("debug");
|
|
38
33
|
debug = __toESM(debug);
|
|
39
|
-
|
|
40
34
|
//#region src/monocloud-session-service.ts
|
|
41
35
|
const CHUNK_BYTE_SIZE = 4090;
|
|
42
36
|
var MonoCloudSessionService = class {
|
|
@@ -211,7 +205,6 @@ var MonoCloudSessionService = class {
|
|
|
211
205
|
for (const cookie$4 of cookies ?? []) await res.setCookie(cookie$4, "", this.getCookieOptions(/* @__PURE__ */ new Date(0)));
|
|
212
206
|
}
|
|
213
207
|
};
|
|
214
|
-
|
|
215
208
|
//#endregion
|
|
216
209
|
//#region src/monocloud-state-service.ts
|
|
217
210
|
var MonoCloudStateService = class {
|
|
@@ -246,7 +239,6 @@ var MonoCloudStateService = class {
|
|
|
246
239
|
};
|
|
247
240
|
}
|
|
248
241
|
};
|
|
249
|
-
|
|
250
242
|
//#endregion
|
|
251
243
|
//#region src/options/defaults.ts
|
|
252
244
|
const DEFAULT_OPTIONS = {
|
|
@@ -304,7 +296,6 @@ const DEFAULT_OPTIONS = {
|
|
|
304
296
|
debugger: "node-auth-core",
|
|
305
297
|
userAgent: "node-auth-core"
|
|
306
298
|
};
|
|
307
|
-
|
|
308
299
|
//#endregion
|
|
309
300
|
//#region src/options/validation.ts
|
|
310
301
|
const stringRequired = joi.default.string().required();
|
|
@@ -448,7 +439,6 @@ const getTokensOptionsSchema = joi.default.object({
|
|
|
448
439
|
scopes: scopesValidationSchema.optional()
|
|
449
440
|
});
|
|
450
441
|
const getSessionOptionsSchema = joi.default.object({ refetchUserInfo: boolOptional });
|
|
451
|
-
|
|
452
442
|
//#endregion
|
|
453
443
|
//#region src/options/get-options.ts
|
|
454
444
|
const getOptions = (options, throwOnError = true) => {
|
|
@@ -576,7 +566,6 @@ const getOptions = (options, throwOnError = true) => {
|
|
|
576
566
|
}
|
|
577
567
|
return value;
|
|
578
568
|
};
|
|
579
|
-
|
|
580
569
|
//#endregion
|
|
581
570
|
//#region src/monocloud-node-core-client.ts
|
|
582
571
|
/**
|
|
@@ -693,7 +682,7 @@ var MonoCloudCoreClient = class {
|
|
|
693
682
|
else prompt = opt.register ? "create" : opt.authParams.prompt;
|
|
694
683
|
if (prompt) params.prompt = prompt;
|
|
695
684
|
/* v8 ignore next -- @preserve */
|
|
696
|
-
if (!params.scopes || params.scopes.length
|
|
685
|
+
if (!params.scopes || params.scopes.length === 0) throw new _monocloud_auth_core.MonoCloudValidationError("Scopes are required for signing in");
|
|
697
686
|
const monoCloudState = {
|
|
698
687
|
returnUrl,
|
|
699
688
|
state,
|
|
@@ -837,7 +826,7 @@ var MonoCloudCoreClient = class {
|
|
|
837
826
|
response.noContent();
|
|
838
827
|
return response.done();
|
|
839
828
|
}
|
|
840
|
-
response.sendJson(
|
|
829
|
+
response.sendJson(newSession.user);
|
|
841
830
|
} catch (error) {
|
|
842
831
|
if (typeof (userinfoOptions === null || userinfoOptions === void 0 ? void 0 : userinfoOptions.onError) === "function") return userinfoOptions.onError(error);
|
|
843
832
|
else this.handleCatchAll(error, response);
|
|
@@ -1108,37 +1097,37 @@ var MonoCloudCoreClient = class {
|
|
|
1108
1097
|
}
|
|
1109
1098
|
}
|
|
1110
1099
|
};
|
|
1111
|
-
|
|
1112
1100
|
//#endregion
|
|
1113
|
-
Object.defineProperty(exports,
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1101
|
+
Object.defineProperty(exports, "MonoCloudAuthBaseError", {
|
|
1102
|
+
enumerable: true,
|
|
1103
|
+
get: function() {
|
|
1104
|
+
return _monocloud_auth_core.MonoCloudAuthBaseError;
|
|
1105
|
+
}
|
|
1118
1106
|
});
|
|
1119
1107
|
exports.MonoCloudCoreClient = MonoCloudCoreClient;
|
|
1120
|
-
Object.defineProperty(exports,
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1108
|
+
Object.defineProperty(exports, "MonoCloudHttpError", {
|
|
1109
|
+
enumerable: true,
|
|
1110
|
+
get: function() {
|
|
1111
|
+
return _monocloud_auth_core.MonoCloudHttpError;
|
|
1112
|
+
}
|
|
1125
1113
|
});
|
|
1126
|
-
Object.defineProperty(exports,
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1114
|
+
Object.defineProperty(exports, "MonoCloudOPError", {
|
|
1115
|
+
enumerable: true,
|
|
1116
|
+
get: function() {
|
|
1117
|
+
return _monocloud_auth_core.MonoCloudOPError;
|
|
1118
|
+
}
|
|
1131
1119
|
});
|
|
1132
|
-
Object.defineProperty(exports,
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1120
|
+
Object.defineProperty(exports, "MonoCloudTokenError", {
|
|
1121
|
+
enumerable: true,
|
|
1122
|
+
get: function() {
|
|
1123
|
+
return _monocloud_auth_core.MonoCloudTokenError;
|
|
1124
|
+
}
|
|
1137
1125
|
});
|
|
1138
|
-
Object.defineProperty(exports,
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1126
|
+
Object.defineProperty(exports, "MonoCloudValidationError", {
|
|
1127
|
+
enumerable: true,
|
|
1128
|
+
get: function() {
|
|
1129
|
+
return _monocloud_auth_core.MonoCloudValidationError;
|
|
1130
|
+
}
|
|
1143
1131
|
});
|
|
1132
|
+
|
|
1144
1133
|
//# sourceMappingURL=index.cjs.map
|