UI的路由器404 ADAL重定向时路由器、重定向、UI、ADAL

2023-09-13 03:05:00 作者:娇喘热潮

我目前正试图在Azure Directory身份验证库(ADAL.JS)在挂接到UI的路由器。我知道了有线的,它正确地重定向,但重定向之前,它总是夹头404。重定向的工作原理,然后被送回我的应用程序,它显示404。

I'm currently trying to hook in the Azure Directory Authentication Library (ADAL.JS) into UI-Router. I've got it wired in, and it redirects correctly, but it always chucks a 404 before the redirect. The redirect works, and then gets sent back to my application, which is showing the 404.

我修改了状态,像这样:

I've modified the state like so:

        {
            state: 'admin',
            config: {
                url: '/admin',
                templateUrl: 'app/admin/admin.html',
                controller: 'AdminController',
                controllerAs: 'vm',
                title: 'Admin',
                settings: {
                    nav: 2,
                    content: '<i class="fa fa-lock"></i> Admin'
                },
                requireADLogin: true
            }

我知道了与正常角RouteProvider的工作,并没有404被抛出。

I've got it working with the normal Angular RouteProvider, and no 404 is being thrown.

应用程序我试图把它变成下探由约翰·帕帕斯呦热毛巾发生器产生。

The application I'm attempting to plumb it into was generated by John Papas Yo Hot Towel generator.

推荐答案

这看起来像adal.js.一个bug UI的路由器使用状态的变化。我看到在设置起始页比较路由变化处理状态变化的一个区别。它应该是:

This looks like a bug in adal.js. ui-router is using state changes. I see one difference in setting the start page for state changes comparing to the route change handler. It should be :

_adal._saveItem(_adal.CONSTANTS.STORAGE.START_PAGE, $location.$$path);

而不是

_adal._saveItem(_adal.CONSTANTS.STORAGE.START_PAGE, nextRoute.url);
 
精彩推荐
图片推荐