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

[NEW] Service account one-tap login #7

Merged
merged 12 commits into from Jun 27, 2019
Merged

Conversation

bhardwajaditya
Copy link
Owner

service-account-one-tap-login

This pull request needs to be reviewed after the callbacks one.

@@ -20,6 +20,7 @@ export class Users extends Base {
this.tryEnsureIndex({ type: 1 });
this.tryEnsureIndex({ 'visitorEmails.address': 1 });
this.tryEnsureIndex({ federation: 1 }, { sparse: true });
this.tryEnsureIndex({ 'u._id': 1 });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good

if (Meteor.user().u) {
username = Meteor.user().u.username;
}
console.log(username);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the log statement. Isn't the lint test supposed to give error on log statements?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, it should, I will update this.

import { Users } from '../../../models';

Meteor.methods({
getLoginToken(username) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about the case when the user corresponding to neither Meteor.userId and nor username has a .u property?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ohh yes, I need to throw an error for that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Due to high security concerns in this method, I'd recommend structuring it like.. for the case we want to return, generate and return.. for everything else raise Error

@kb0304 kb0304 merged commit fdac5d2 into service-accounts Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants