Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix cannot use this inside model #320

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

Closed
thakerng wants to merge 1 commit into oauthjs:master from thakerng:master
Closed

Conversation

@thakerng
Copy link

@thakerng thakerng commented Jul 15, 2016

Cannot use this inside model because in Promise.try haven't passed context of model yet.

maxtruxa and epeterson320 reacted with thumbs up emoji
Copy link
Member

maxtruxa commented Jul 15, 2016
edited
Loading

I think it wasn't the intention to allow this (no pun intended) as model was supposed to be just a plain object, but I like the change. The ability to use this would be really useful to implement a stateful model.

Could you add tests to verify the added functionality?

AbstractGrantType.prototype.generateAccessToken = function() {
if (this.model.generateAccessToken) {
return Promise.try(this.model.generateAccessToken);
return Promise.try(this.model.generateAccessToken,[],this.model);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a space before [] please? 😄

AbstractGrantType.prototype.generateRefreshToken = function() {
if (this.model.generateRefreshToken) {
return Promise.try(this.model.generateRefreshToken);
return Promise.try(this.model.generateRefreshToken,[],this.model);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a space before [] please? 😄

Copy link
Contributor

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nunofgs nunofgs nunofgs requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /