OAuth2 redirect URI to AngularJS application with hash in URI

I have an oAuth2 service where I want to pass the redirect_uri parameter as a URL somewhere in my AngularJS application. http://localhost:8080/#/twitter/listbut my oAuth2 provider does not recognize urls with hash characters in them. I tried changing the url as http://localhost:8080/%23/twitter/list, but Angular does not seem to recognize the path, and I get the following error in my browser:

Cannot GET /%23/twitter/list

How can I get the redirect back to my AngularJS application to work?

+4
source share
1 answer

. ( IE), HTML 5, . , .

$locationProvider, . , ui-router ( ng-router):

angular.module('app').config(function( $stateProvider, 
    $urlRouterProvider, $locationProvider ){
    //Routes
    //...
    $locationProvider.html5Mode(true);
}

. , .

0

Source: https://habr.com/ru/post/1546769/


All Articles