customer_service_im 0.5.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef3046967b653b6fef336b498b9ce38b2cf38f83a438cc7b0a6940f643521534
|
4
|
+
data.tar.gz: 0ea99dfdc1571c5ed16248cbcb68e9267aadffa2c0b10cbb94039bf873ab7818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e8a80069a9478884028aed58ca3219ead1719f1d80836fb8a95f0b04d91a7e5ae792ab68c1e6ad0bd93f4ba3b8bd9889d502e08bd51bdca9e0181c6f8b844c8
|
7
|
+
data.tar.gz: 998059851c9d83fd45a526fa9d2970cb93547796deb809c45d97ae5b92ff9f0b7c865b356dfa2b273b10d60a6faf7d894b9371aa864797f5d3e26f1c0fbfe789
|
@@ -11,7 +11,7 @@ module CustomerServiceIm
|
|
11
11
|
|
12
12
|
open_id = result.data[:openid]
|
13
13
|
|
14
|
-
user = User.
|
14
|
+
user = User.find_or_create_mp_user(open_id)
|
15
15
|
|
16
16
|
render_200 user.as_json.merge({ token: token_user(user), conversation_id: user.conversation_ids.first })
|
17
17
|
end
|
@@ -71,5 +71,14 @@ module CustomerServiceIm::Concerns::Customer
|
|
71
71
|
def online_customer_list_in_redis
|
72
72
|
redis.smembers online_customers_redis_key
|
73
73
|
end
|
74
|
+
|
75
|
+
def find_or_create_mp_user(open_id)
|
76
|
+
return if open_id.blank?
|
77
|
+
|
78
|
+
User.create_with(
|
79
|
+
email: "#{SecureRandom.uuid}@mp.com",
|
80
|
+
password: Digest::MD5.hexdigest(open_id)
|
81
|
+
).find_or_create_by(open_id: open_id)
|
82
|
+
end
|
74
83
|
end
|
75
84
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: customer_service_im
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ian
|
@@ -128,6 +128,20 @@ dependencies:
|
|
128
128
|
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: bcrypt
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :runtime
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
131
145
|
description: Description of CustomerServiceIm.
|
132
146
|
email:
|
133
147
|
- ianlynxk@gmail.com
|