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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make window-options and callback-url configurable #6

Closed

Conversation

hansemannn
Copy link
Contributor

JIRA: https://jira.appcelerator.org/browse/TIMOB-24576

Moving the AUTH_WINDOW_OPTIONS and CALLBACK_URL to configurable properties of the OAuth class, trying to keep full backwards-compatibility by specifying default values. We should remove the default callback-url and window title in 1.0.0 and validate the callback-url before it's usage. The check may even be done earlier, please advice @sgtcoolguy 馃檪.

Copy link
Collaborator

@sgtcoolguy sgtcoolguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think this change is good for the long-term, but I see that it doesn't actually work as expected (by the failed test). And it raises the issue that isgnoreSslError likely also fails.

You're moving them to be properties on an instance of OAuth. The methods they're used within are not instance/prototype methods, but are "static"/class-level methods. So this.callbackUrl, this.ignoreSslError and this.authWindow are all undefined.

@@ -108,6 +97,12 @@ var OAuth = function OAuth(clientId) {
this.tokenType = null;
this.expiresIn = 0;
this.ignoreSslError = false;
this.callbackUrl = 'http://localhost/Callback'; // FIXME: We should remove this in the next major release, keeping for backwards compatibility.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK, but...

@@ -221,7 +216,7 @@ OAuth.authorizeImplicitly = function(url, clientId, scopes, callback) {
url : buildURL(url, {
scope: scopes,
approval_prompt: 'force',
redirect_uri: CALLBACK_URL,
redirect_uri: this.callbackUrl,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...here it's undefined!

@sgtcoolguy
Copy link
Collaborator

Closed in favor of #7

@sgtcoolguy sgtcoolguy closed this Apr 13, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants