You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
UnauthorizedError: No authorization token was found after building app (IE11) #1880
I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Latest version of the stack.
Item
Version
generator-angular-fullstack
x.x.x
Node
x.x.x
npm
x.x.x
Operating System
OS X 10 / Windows 10 / Ubuntu 15.10 / etc
etc
etc
Item
Answer
Transpiler
Babel
Markup
HTML
CSS
CSS
Router
ui-router
Build Tool
Grunt
Client Tests
Jasmine / Mocha
DB
MongoDB
Auth
Y
Hello, i finally put one of my apps into production (built) for testing and noticed that users cannot login when using IE 11..
I get the following error in the server console:
UnauthorizedError: No authorization token was found
at middleware (C:\Apps\DataFusion\dist\node_modules\express-jwt\lib\index.js
:80:21)
at Middleware_Common_Object.<anonymous> (C:\Apps\DataFusion\dist\server\auth
\auth.service.js:53:9)
at next (C:\Apps\DataFusion\dist\node_modules\composable-middleware\lib\comp
osable-middleware.js:59:18)
at Middleware_Common_Object.middleware (C:\Apps\DataFusion\dist\node_modules
\composable-middleware\lib\composable-middleware.js:76:7)
at middleware (C:\Apps\DataFusion\dist\node_modules\composable-middleware\li
b\composable-middleware.js:31:25)
at Layer.handle [as handle_request] (C:\Apps\DataFusion\dist\node_modules\ex
press\lib\router\layer.js:95:5)
at next (C:\Apps\DataFusion\dist\node_modules\express\lib\router\route.js:13
1:13)
at Route.dispatch (C:\Apps\DataFusion\dist\node_modules\express\lib\router\r
oute.js:112:3)
at Layer.handle [as handle_request] (C:\Apps\DataFusion\dist\node_modules\ex
press\lib\router\layer.js:95:5)
at C:\Apps\DataFusion\dist\node_modules\express\lib\router\index.js:277:22
at Function.process_params (C:\Apps\DataFusion\dist\node_modules\express\lib
\router\index.js:330:12)
at next (C:\Apps\DataFusion\dist\node_modules\express\lib\router\index.js:27
1:10)
at Function.handle (C:\Apps\DataFusion\dist\node_modules\express\lib\router\
index.js:176:3)
at router (C:\Apps\DataFusion\dist\node_modules\express\lib\router\index.js:
46:12)
at Layer.handle [as handle_request] (C:\Apps\DataFusion\dist\node_modules\ex
press\lib\router\layer.js:95:5)
at trim_prefix (C:\Apps\DataFusion\dist\node_modules\express\lib\router\inde
x.js:312:13)
at C:\Apps\DataFusion\dist\node_modules\express\lib\router\index.js:280:7
at Function.process_params (C:\Apps\DataFusion\dist\node_modules\express\lib
\router\index.js:330:12)
at next (C:\Apps\DataFusion\dist\node_modules\express\lib\router\index.js:27
1:10)
at logger (C:\Apps\DataFusion\dist\node_modules\morgan\index.js:144:5)
at Layer.handle [as handle_request] (C:\Apps\DataFusion\dist\node_modules\ex
press\lib\router\layer.js:95:5)
at trim_prefix (C:\Apps\DataFusion\dist\node_modules\express\lib\router\inde
x.js:312:13)
GET /api/users/me 401 1.228 ms - 13
I get this error after the user authorization has completed, after building the app and trying to log in with IE11. It works fine in Chrome.. and IE 11 works find when not running in prod (running grunt serve). So i am posting here before troubleshooting further to make sure its not a bug in the generator.
Which version of the generator did you use? "Latest version of the stack." doesn't really help, especially if you're using a beta version or if someone looks at this issue in the future, once the generator version has been increased.
UnauthorizedError: No authorization token was found
You're sure that you ran the same steps and Chrome worked but IE11 failed? Was an auth token sent? If so, was it formatted properly?
When i pulled this info i was running it on port 9000 with NGINX as a proxy but it does the same thing when running it directly on port 80 without NGINX.
I have the same problem, when the port number is 80 or 443..
The following fix solved the issue for me with other port numbers, such as 9000: #1523
However with port 80 or 443 it doesn't work: The problems seems to be in isSameOrigin() in util.service.js: Internet Explorer (11 which I'm testing) doesn't set $window.location.port to 80 but to "". $window.location is pushed to the origins vector and then filtered with the port number of url (which is 80) in isSameOrigin() and they don't match.
@whittssg okay it's useful to know that you're using 3.5.0, because that indeed is not the latest version.
Ugh, IE is such a pain in the ass. @erikrenberg I think that that fix would be fine, with a comment with a link to the IE bug. Do you want to make a PR?
Activity
Awk34 commentedon May 13, 2016
Which version of the generator did you use? "Latest version of the stack." doesn't really help, especially if you're using a beta version or if someone looks at this issue in the future, once the generator version has been increased.
UnauthorizedError: No authorization token was foundYou're sure that you ran the same steps and Chrome worked but IE11 failed? Was an auth token sent? If so, was it formatted properly?
theodu60 commentedon May 13, 2016
Hello,
I have the same problem :(
I think that the auth service is the cause.
whittssg commentedon May 13, 2016
I am using version 3.5.0 of the generator.
Yes i followed the exact same steps on IE, CHROME and FIREFOX.
Request Headers:
Key Value
Request POST /auth/local HTTP/1.1
Content-Type application/json;charset=utf-8
Accept application/json, text/plain, /
X-XSRF-TOKEN D3mmAK4GKQ2skbcea0st0y0Z7hSjfLW9OrtUQ=
Referer http://mydomain.com/login
Accept-Language en-US
Accept-Encoding gzip, deflate
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Host mydomain.com
Content-Length 69
Connection Keep-Alive
Cache-Control no-cache
Cookie _ga=GA1.2.1036502328.1449502252; _mkto_trk=id:565-YXD-236&token:_mch-carefusion.com-1449502252339-27679; _ga=GA1.3.1036502328.1449502252; _gat=1; XSRF-TOKEN=D3mmAK4GKQ2skbcea0st0y0Z7hSjfLW9OrtUQ%3D; connect.sid=s%3AWZwZ1_j3u6hXYa2q4NqcTF_trnvOrdwq.MbWVMvBRnPKG1I6zPMGa5ta0xGl2QsE3wQm6ROZIdFk
Reponse Headers:
Key Value
Response HTTP/1.1 200 OK
Server nginx/1.9.15
Date Fri, 13 May 2016 12:45:49 GMT
Content-Type application/json; charset=utf-8
Content-Length 204
Connection keep-alive
X-Powered-By Express
Vary X-HTTP-Method-Override, Accept-Encoding
X-XSS-Protection 1; mode=block
X-FRAME-OPTIONS SAMEORIGIN
Strict-Transport-Security max-age=31536000; includeSubDomains; preload
Set-Cookie XSRF-TOKEN=zNexgXQ1XeOAj61M%2BEiCGgDkz0HjLN9oY3xho%3D; Path=/
ETag W/"cc-IXmz5yFM5IXoJcTr8kiUzw"
Response Body
{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJfaWQiOiI1NzMzOGIyZDI1MWVkNDQwMDE5OTA1NTkiLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE0NjMxNDM1NDksImV4cCI6MTQ2MzE2MTU0OX0.OYTxD2CEHhIX9YObRboM_wqyE8Ps07N_wh6z9Uy211g"}
When i pulled this info i was running it on port 9000 with NGINX as a proxy but it does the same thing when running it directly on port 80 without NGINX.
Thanks,
erikrenberg commentedon May 13, 2016
I have the same problem, when the port number is 80 or 443..
The following fix solved the issue for me with other port numbers, such as 9000: #1523
However with port 80 or 443 it doesn't work: The problems seems to be in isSameOrigin() in util.service.js: Internet Explorer (11 which I'm testing) doesn't set $window.location.port to 80 but to "". $window.location is pushed to the origins vector and then filtered with the port number of url (which is 80) in isSameOrigin() and they don't match.
Here's the util.service.js file: https://github.com/angular-fullstack/generator-angular-fullstack/blob/master/templates/app/client/components/util/util.service.js
I'm not sure how to fix it, I can of course avoid filtering if the port is "" but that seems like an ugly fix....
Awk34 commentedon May 13, 2016
@whittssg okay it's useful to know that you're using 3.5.0, because that indeed is not the latest version.
Ugh, IE is such a pain in the ass. @erikrenberg I think that that fix would be fine, with a comment with a link to the IE bug. Do you want to make a PR?
whittssg commentedon May 13, 2016
@Awk34 Sorry about that.. could of sworn i updated a week ago or so. to get it to work for now i just commented out the port check
fix: IE11 log in works for ports 80 and 443
Cdvalencia commentedon May 31, 2017
Hi.
here is the solution: https://stackoverflow.com/a/35964735/4996446