@kaspernj/api-maker 1.0.279 → 1.0.280
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/package.json +1 -1
- package/src/devise.mjs +8 -4
package/package.json
CHANGED
package/src/devise.mjs
CHANGED
|
@@ -63,9 +63,12 @@ export default class ApiMakerDevise {
|
|
|
63
63
|
return {model, response}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
static updateSession (model) {
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
static updateSession (model, args = {}) {
|
|
67
|
+
if (!args.scope) {
|
|
68
|
+
args.scope = digg(model.modelClassData(), "name")
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const camelizedScopeName = inflection.camelize(args.scope, true)
|
|
69
72
|
|
|
70
73
|
ApiMakerDevise.current().currents[camelizedScopeName] = model
|
|
71
74
|
}
|
|
@@ -75,8 +78,9 @@ export default class ApiMakerDevise {
|
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
static async signOut (args = {}) {
|
|
78
|
-
if (!args.scope)
|
|
81
|
+
if (!args.scope) {
|
|
79
82
|
args.scope = "user"
|
|
83
|
+
}
|
|
80
84
|
|
|
81
85
|
const response = await Services.current().sendRequest("Devise::SignOut", {args})
|
|
82
86
|
|