Skip to content

refactor(model:user): exclude password info by default #1620

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

Merged
merged 1 commit into from
Feb 9, 2016
Merged

refactor(model:user): exclude password info by default #1620

merged 1 commit into from
Feb 9, 2016

Conversation

carragom
Copy link

@carragom carragom commented Feb 9, 2016

based on PR #1049 from @Awk34 commit (5fecaba).

Hi, this is another attempt at excluding the password info by default and not just at query time. The sequelize way of doing it is not pretty but seems to be the recommended way. And it does not look like there will be a different way anytime soon.

@Awk34
Copy link
Member

Awk34 commented Feb 9, 2016

LGTM

Awk34 added a commit that referenced this pull request Feb 9, 2016
refactor(model:user): exclude password info by default
@Awk34 Awk34 merged commit 70d3117 into angular-fullstack:canary Feb 9, 2016
@Awk34
Copy link
Member

Awk34 commented Feb 9, 2016

Hmm, looks like the sequelize one isn't quite working. Have you tested it? I see this in the failed build: Can't canonicalize query: BadValue Projection cannot have a mix of inclusion and exclusion.

@Awk34
Copy link
Member

Awk34 commented Feb 9, 2016

Also

1) User API: GET /api/users/me should respond with a user profile when authenticated:
Uncaught TypeError: Cannot read property 'toString' of undefined
at Test.<anonymous> (server/api/user/user.integration.js:53:23)
at Test.assert (/home/rof/src/github.com/angular-fullstack/generator-angular-fullstack/test/fixtures/node_modules/supertest/lib/test.js:156:6)
at Server.assert (/home/rof/src/github.com/angular-fullstack/generator-angular-fullstack/test/fixtures/node_modules/supertest/lib/test.js:127:12)
at emitCloseNT (net.js:1524:8)

@Awk34
Copy link
Member

Awk34 commented Feb 17, 2016

I have reverted this. If you can find a fix, feel free to submit another PR.

@@ -228,6 +229,12 @@ module.exports = function(sequelize, DataTypes) {
} else {
fn(null);
}
},

toJSON: function() {
Copy link
Member

Choose a reason for hiding this comment

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

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

Successfully merging this pull request may close these issues.

2 participants