auth0 / angular-jwt

Library to help you work with JWTs on AngularJS
MIT License
0 stars 1 forks source link

Routes without jwt authentication are still loading #191

Closed RuiPascoal closed 4 years ago

RuiPascoal commented 5 years ago

I have a Register page, which does not have jwt authentication since the jwt is only created after login is done. But both the Register page template, and the register http request are not blocked by the interceptor.

Here's my interceptor config. `

function jwtInterceptor($httpProvider, jwtOptionsProvider) {
    jwtOptionsProvider.config({
        /*whiteListedDomains: [
            'localhost'
        ],*/
        tokenGetter: ['options', function (options) {
            /*if (options.url.substr(options.url.length - 5) == '.html') {
                return null;
            }*/
            return localStorage.getItem('currentUser.token');
        }]      
    });
    $httpProvider.interceptors.push('jwtInterceptor');           
};

`

I commented the domain whitelist and the .html options, but either way, the Register page and request are still allowed. What is going wrong here? Why is it not blocking the Register page, which does not have a jwt?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️