script src MIME type html or javascript? [closed]

How to fix the problem of wrong MIME type, if a javascript page will firstly redirect you to a html login page, before it shows the javascript page after a successful auto login? For example:

mypage.html:

...
<script src="https://www.cba.com/123.js" type="text/javascript"></script>

This code will create a MIME type error, as the login page redirected from the js page is of html type. Is there any better way to include the js page as a script?