Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initView function calling logout in infinite loop #141

Open
pottabathini opened this issue Oct 25, 2016 · 2 comments
Open

initView function calling logout in infinite loop #141

pottabathini opened this issue Oct 25, 2016 · 2 comments

Comments

@pottabathini
Copy link

I am trying to integrate oauth-ng in my application by setting up manual configuration. we observe following issues.

  1. When it set request type 'token id_token' application blindly showing access denied link even my provider returns everything.
  2. When we set log-out URL the oauth-ng JS file initView checking for AccessToken when it is null it is calling for logout method. and this process repeating infinitely.
    When I check oauth-ng.js initView function it is expecting token to be available on initial page load only. if token not available then it calling logout.
    I put <oauth tag on landing page itself because of that initView calling on page loading and it calling infinitely logout URL.
@baywet
Copy link

baywet commented Nov 28, 2016

having the same problem, I'm insterested into the fix.

@baywet
Copy link

baywet commented Nov 29, 2016

I worked that around not using the directive's setting but rather implementing the logout event and doing the redirection myself.
$rootScope.$on('oauth:logout', function() {
if(!($rootScope.accessToken === null || $rootScope.accessToken === undefined)){//otherwise infinite redirect loop
$rootScope.accessToken = null;
var tempIdToken = $rootScope.idToken;
$rootScope.idToken = null;
var redirectLink = URLTOENDSESSIONENDPOINT+ '?post_logout_redirect_uri=' + POSTLOGOUTURL + '&id_token_hint=' + tempIdToken;
$window.open(redirectLink, '_self');
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants