@live-change/message-authentication-service 0.2.4 → 0.2.5
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/index.js +11 -4
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -137,15 +137,19 @@ definition.action({
|
|
|
137
137
|
secret: {
|
|
138
138
|
type: String,
|
|
139
139
|
validation: ['nonEmpty']
|
|
140
|
+
},
|
|
141
|
+
authentication: {
|
|
142
|
+
type: Authentication
|
|
140
143
|
}
|
|
141
144
|
},
|
|
142
|
-
async execute({ secretType, secret }, { client, service }, emit) {
|
|
145
|
+
async execute({ secretType, secret, authentication = undefined }, { client, service }, emit) {
|
|
143
146
|
const secretTypeUpperCase = secretType[0].toUpperCase() + secretType.slice(1)
|
|
144
147
|
const checkResults = await service.trigger({
|
|
145
148
|
type: 'check' + secretTypeUpperCase + 'Secret',
|
|
146
|
-
secret
|
|
149
|
+
secret,
|
|
150
|
+
authentication
|
|
147
151
|
})
|
|
148
|
-
|
|
152
|
+
authentication = checkResults[0]
|
|
149
153
|
const authenticationData = await Authentication.get(authentication)
|
|
150
154
|
if(authenticationData.state == 'used') throw 'authenticationUsed'
|
|
151
155
|
const actionName = authenticationData.action
|
|
@@ -160,7 +164,10 @@ definition.action({
|
|
|
160
164
|
type: 'authenticationUsed',
|
|
161
165
|
authentication
|
|
162
166
|
})
|
|
163
|
-
return
|
|
167
|
+
return {
|
|
168
|
+
result: actionResults[0],
|
|
169
|
+
targetPage: authenticationData.targetPage
|
|
170
|
+
}
|
|
164
171
|
}
|
|
165
172
|
})
|
|
166
173
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/message-authentication-service",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@live-change/framework": "^0.5.7",
|
|
25
25
|
"nodemailer": "^6.7.2"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "e9f8af40d836388f6847cf958c1d941dc8e273b1"
|
|
28
28
|
}
|