回答編集履歴
2
追記
test
CHANGED
@@ -56,7 +56,33 @@
|
|
56
56
|
|
57
57
|
};
|
58
58
|
|
59
|
+
/**
|
59
60
|
|
61
|
+
const createAnonymUser = (req, res, next) => {
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
if (!req.cookies.anonymUser && !req.user) {
|
66
|
+
|
67
|
+
User.create({ username: 'anonymous', displayName: '名無しさん' })
|
68
|
+
|
69
|
+
.then( anonymUser => {
|
70
|
+
|
71
|
+
res.cookie('anonymUser', anonymUser);
|
72
|
+
|
73
|
+
return next();
|
74
|
+
|
75
|
+
})
|
76
|
+
|
77
|
+
})();
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
else next();
|
82
|
+
|
83
|
+
};
|
84
|
+
|
85
|
+
*/
|
60
86
|
|
61
87
|
module.exports = createAnonymUser;
|
62
88
|
|
1
追記
test
CHANGED
File without changes
|