Open pinnprophead opened 8 years ago
Why not using an ng-if on the oauth2 tag with a flag (or even a value) ?
The ng-if disable the component and prevent interpretation of directive.
For example :
<oauth2 ng-if="loginEndpoint" authorization-url="{{loginEndpoint}}"
sign-out-url="{{logoutEndpoint}}"
sign-out-append-token="true"
client-id="{{appKey}}"
redirect-url="{{redirectEndpoint}}"
sign-out-redirect-url="{{redirectEndpoint}}"
sign-in-text="Log In"
sign-out-text="Log Out"
response-type="id_token token"
scope="openid profile email roles all_claims">
</oauth2>
The problem I had was that since the init for the oauth2.endpoint was being called when the directive was loaded, my values for the urls were not being used -- my bootstrap process determines the urls and so they are not known right away.
For example:
In order to fix it, I just re-called init for the oauth2.endpoint module in the directive's login method. I hope that makes sense -- it doesn't seem like it would be very expensive...
This is just an FYI -- not sure if you want to take any action on it.