Detect mobile & desktop safari server side

This commit is contained in:
Chi Vinh Le
2017-05-26 20:58:48 +07:00
parent 6a1befc3f0
commit 6a9f216c0f
+1 -1
View File
@@ -51,7 +51,7 @@ const HandleGenerateCredentials = (req, res, next) => (err, user) => {
// If the user is Safari, let's send a cookie
const browser = bowser._detect(req.headers['user-agent']);
if (browser.name === 'Safari') {
if (browser.ios || browser.safari) {
res.cookie('authorization', token, {
httpOnly: true,
expires: new Date(Date.now() + 900000)