Skip to content

Commit 2362103

Browse files
justcfx2uAwk34
authored andcommitted
fix(authorization): header workaround for IE11
use cookie instead so auth succeeds closes #2051
1 parent f978574 commit 2362103

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: templates/app/server/auth(auth)/auth.service.js

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export function isAuthenticated() {
2424
if (req.query && req.query.hasOwnProperty('access_token')) {
2525
req.headers.authorization = 'Bearer ' + req.query.access_token;
2626
}
27+
// IE11 forgets to set Authorization header sometimes. Pull from cookie instead.
28+
if (req.query && typeof req.headers.authorization === 'undefined') {
29+
req.headers.authorization = 'Bearer ' + req.cookies.token;
30+
}
2731
validateJwt(req, res, next);
2832
})
2933
// Attach user to request

0 commit comments

Comments
 (0)