Skip to content

[NEW] Service account one-tap login#7

Merged
kb0304 merged 12 commits intoservice-accountsfrom
service-account-login
Jun 27, 2019
Merged

[NEW] Service account one-tap login#7
kb0304 merged 12 commits intoservice-accountsfrom
service-account-login

Conversation

@bhardwajaditya
Copy link
Copy Markdown
Owner

service-account-one-tap-login

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

this.tryEnsureIndex({ type: 1 });
this.tryEnsureIndex({ 'visitorEmails.address': 1 });
this.tryEnsureIndex({ federation: 1 }, { sparse: true });
this.tryEnsureIndex({ 'u._id': 1 });
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

2 participants