|
|
@@ -24,8 +24,8 @@ app.all('/register', function(req, res) {
|
|
24
|
24
|
var uquery = 'user:' + tmp_username;
|
|
25
|
25
|
var user_object = {};
|
|
26
|
26
|
|
|
27
|
|
- redis.get(uquery).then(function (result) {
|
|
28
|
|
- if (result !== "" && result !== undefined && result !== null) {
|
|
|
27
|
+ redis.hgetall(uquery).then(function (result) {
|
|
|
28
|
+ if (result.password && result !== undefined && result !== null) {
|
|
29
|
29
|
res.send({"registered": 0,
|
|
30
|
30
|
"error": 1});
|
|
31
|
31
|
} else {
|
|
|
@@ -50,7 +50,7 @@ app.all('/login', function(req, res) {
|
|
50
|
50
|
var uquery = 'user:' + username;
|
|
51
|
51
|
|
|
52
|
52
|
redis.hgetall(uquery).then(function (result) {
|
|
53
|
|
- if (result !== "" && result !== undefined && result !== null) {
|
|
|
53
|
+ if (result.password && result !== undefined && result !== null) {
|
|
54
|
54
|
var user_object = result;
|
|
55
|
55
|
if (auth_key !== "" && auth_key !== undefined && auth_key !== null) {
|
|
56
|
56
|
if (auth_key === user_object["auth-key"]) {
|