@live-change/phone-service 0.8.31 → 0.8.32
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/auth.js +3 -5
- package/package.json +4 -4
package/auth.js
CHANGED
|
@@ -144,8 +144,7 @@ definition.trigger({
|
|
|
144
144
|
if(!phone) throw new Error("no phone")
|
|
145
145
|
const phoneData = await Phone.get(phone)
|
|
146
146
|
if(phoneData) throw { properties: { phone: 'taken' } }
|
|
147
|
-
await service.trigger({
|
|
148
|
-
type: 'contactConnected',
|
|
147
|
+
await service.trigger({ type: 'contactConnected' }, {
|
|
149
148
|
contactType: 'phone_Phone',
|
|
150
149
|
contact: phone,
|
|
151
150
|
user
|
|
@@ -173,7 +172,7 @@ definition.trigger({
|
|
|
173
172
|
async execute({ user, phone }, { client, service }, emit) {
|
|
174
173
|
const phoneData = await Phone.get(phone)
|
|
175
174
|
if(!phoneData) throw { properties: { phone: 'notFound' } }
|
|
176
|
-
if(phoneData.user
|
|
175
|
+
if(phoneData.user !== user) throw { properties: { phone: 'notFound' } }
|
|
177
176
|
emit({
|
|
178
177
|
type: 'phoneDisconnected',
|
|
179
178
|
user, phone
|
|
@@ -194,8 +193,7 @@ definition.trigger({
|
|
|
194
193
|
const phoneData = await Phone.get(phone)
|
|
195
194
|
if(!phoneData) throw { properties: { phone: 'notFound' } }
|
|
196
195
|
const { user } = phoneData
|
|
197
|
-
return service.trigger({
|
|
198
|
-
type: 'signIn',
|
|
196
|
+
return service.trigger({ type: 'signIn' }, {
|
|
199
197
|
user, session
|
|
200
198
|
})
|
|
201
199
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/phone-service",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@live-change/framework": "^0.8.
|
|
26
|
-
"@live-change/relations-plugin": "^0.8.
|
|
25
|
+
"@live-change/framework": "^0.8.32",
|
|
26
|
+
"@live-change/relations-plugin": "^0.8.32",
|
|
27
27
|
"got": "^11.8.3",
|
|
28
28
|
"html-to-text": "8.1.0",
|
|
29
29
|
"jsdom": "^18.1.1",
|
|
30
30
|
"smsapi": "2.0.9"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "9ea7767670a99404794087726223064c45d798d3"
|
|
33
33
|
}
|